Trait streambed_patterns::ask::Ask

source ·
pub trait Ask<A> {
    // Required method
    fn ask<'life0, 'async_trait, F, R>(
        &'life0 self,
        f: F,
    ) -> Pin<Box<dyn Future<Output = Result<R, AskError>> + Send + 'async_trait>>
       where F: FnOnce(Box<dyn FnOnce(R) + Send>) -> A + Send + 'async_trait,
             R: Send + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn ask<'life0, 'async_trait, F, R>( &'life0 self, f: F, ) -> Pin<Box<dyn Future<Output = Result<R, AskError>> + Send + 'async_trait>>
where F: FnOnce(Box<dyn FnOnce(R) + Send>) -> A + Send + 'async_trait, R: Send + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

The ask pattern is a way to send a request and get a reply back.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A> Ask<A> for Sender<A>
where A: Send,

source§

fn ask<'life0, 'async_trait, F, R>( &'life0 self, f: F, ) -> Pin<Box<dyn Future<Output = Result<R, AskError>> + Send + 'async_trait>>
where F: FnOnce(Box<dyn FnOnce(R) + Send>) -> A + Send + 'async_trait, R: Send + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Implementors§