Skip to main content

OptionFutureExt

Trait OptionFutureExt 

Source
pub trait OptionFutureExt<T> {
    // Required methods
    fn is_none_or(
        self,
        f: impl FnOnce(&T) -> bool + Send,
    ) -> impl Future<Output = bool> + Send;
    fn is_some_and(
        self,
        f: impl FnOnce(&T) -> bool + Send,
    ) -> impl Future<Output = bool> + Send;
    fn unwrap_or(self, t: T) -> impl Future<Output = T> + Send;
    fn unwrap_or_default(self) -> impl Future<Output = T> + Send
       where T: Default;
    fn unwrap_or_else(
        self,
        f: impl FnOnce() -> T + Send,
    ) -> impl Future<Output = T> + Send;
    fn unwrap_or_else_async<F: Future<Output = T> + Send>(
        self,
        f: impl FnOnce() -> F + Send,
    ) -> impl Future<Output = Option<T>> + Send;
}

Required Methods§

Source

fn is_none_or( self, f: impl FnOnce(&T) -> bool + Send, ) -> impl Future<Output = bool> + Send

Source

fn is_some_and( self, f: impl FnOnce(&T) -> bool + Send, ) -> impl Future<Output = bool> + Send

Source

fn unwrap_or(self, t: T) -> impl Future<Output = T> + Send

Source

fn unwrap_or_default(self) -> impl Future<Output = T> + Send
where T: Default,

Source

fn unwrap_or_else( self, f: impl FnOnce() -> T + Send, ) -> impl Future<Output = T> + Send

Source

fn unwrap_or_else_async<F: Future<Output = T> + Send>( self, f: impl FnOnce() -> F + Send, ) -> impl Future<Output = Option<T>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, Fut> OptionFutureExt<T> for OptionFuture<Fut>
where Fut: Future<Output = T> + Send, T: Send,

Source§

fn is_none_or( self, f: impl FnOnce(&T) -> bool + Send, ) -> impl Future<Output = bool> + Send

Source§

fn is_some_and( self, f: impl FnOnce(&T) -> bool + Send, ) -> impl Future<Output = bool> + Send

Source§

fn unwrap_or(self, t: T) -> impl Future<Output = T> + Send

Source§

fn unwrap_or_default(self) -> impl Future<Output = T> + Send
where T: Default,

Source§

fn unwrap_or_else( self, f: impl FnOnce() -> T + Send, ) -> impl Future<Output = T> + Send

Source§

fn unwrap_or_else_async<F: Future<Output = T> + Send>( self, f: impl FnOnce() -> F + Send, ) -> impl Future<Output = Option<T>> + Send

Implementors§