Trait AsyncOptionTools

Source
pub trait AsyncOptionTools<T> {
    // Required methods
    fn is_some_and_async<F, Fut>(self, f: F) -> impl Future<Output = bool>
       where F: FnOnce(T) -> Fut,
             Fut: Future<Output = bool>;
    fn is_none_or_async<F, Fut>(self, f: F) -> impl Future<Output = bool>
       where F: FnOnce(T) -> Fut,
             Fut: Future<Output = bool>;
    fn map_async<B, F, Fut>(self, f: F) -> impl Future<Output = Option<B>>
       where F: FnOnce(T) -> Fut,
             Fut: Future<Output = B>;
}

Required Methods§

Source

fn is_some_and_async<F, Fut>(self, f: F) -> impl Future<Output = bool>
where F: FnOnce(T) -> Fut, Fut: Future<Output = bool>,

Source

fn is_none_or_async<F, Fut>(self, f: F) -> impl Future<Output = bool>
where F: FnOnce(T) -> Fut, Fut: Future<Output = bool>,

Source

fn map_async<B, F, Fut>(self, f: F) -> impl Future<Output = Option<B>>
where F: FnOnce(T) -> Fut, Fut: Future<Output = B>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> AsyncOptionTools<T> for Option<T>

Source§

async fn is_some_and_async<F, Fut>(self, f: F) -> bool
where F: FnOnce(T) -> Fut, Fut: Future<Output = bool>,

Source§

async fn is_none_or_async<F, Fut>(self, f: F) -> bool
where F: FnOnce(T) -> Fut, Fut: Future<Output = bool>,

Source§

async fn map_async<B, F, Fut>(self, f: F) -> Option<B>
where F: FnOnce(T) -> Fut, Fut: Future<Output = B>,

Implementors§