feat: user consent setting and retrieving (NOTE: does not affect recording yet)
This commit is contained in:
11
src/option_ext.rs
Normal file
11
src/option_ext.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use extension_traits::extension;
|
||||
|
||||
#[extension(pub trait OptionExt)]
|
||||
impl<S> Option<S> {
|
||||
async fn map_async<M, Fut: Future<Output = M>, F: FnOnce(S) -> Fut>(self, f: F) -> Option<M> {
|
||||
match self {
|
||||
Some(s) => Some(f(s).await),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user