Skip to main content

CommandHandle

Trait CommandHandle 

Source
pub trait CommandHandle<T, E: From<Error> + Clone + Debug + Send + Sync + 'static, S: Debug + Clone + Send + Sync + 'static>:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        context: Context<E, S>,
    ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, context: Context<E, S>, ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<E, S, F> CommandHandle<(), E, S> for F
where E: From<Error> + Clone + Debug + Send + Sync + 'static, S: Debug + Clone + Send + Sync + 'static, F: AsyncFn1<Context<E, S>, Output = Result<(), E>> + Send + Sync + 'static, F::OutputFuture: Send,

Source§

impl<T1, E, S, F> CommandHandle<(T1,), E, S> for F
where T1: Converter<E, S> + Send, E: From<Error> + Clone + Debug + Send + Sync + 'static, S: Debug + Clone + Send + Sync + 'static, F: AsyncFn2<Context<E, S>, T1, Output = Result<(), E>> + Send + Sync + 'static, F::OutputFuture: Send,

Source§

impl<T1, T2, E, S, F> CommandHandle<(T1, T2), E, S> for F
where T1: Converter<E, S> + Send, T2: Converter<E, S> + Send, E: From<Error> + Clone + Debug + Send + Sync + 'static, S: Debug + Clone + Send + Sync + 'static, F: AsyncFn3<Context<E, S>, T1, T2, Output = Result<(), E>> + Send + Sync + 'static, F::OutputFuture: Send,

Source§

impl<T1, T2, T3, E, S, F> CommandHandle<(T1, T2, T3), E, S> for F
where T1: Converter<E, S> + Send, T2: Converter<E, S> + Send, T3: Converter<E, S> + Send, E: From<Error> + Clone + Debug + Send + Sync + 'static, S: Debug + Clone + Send + Sync + 'static, F: AsyncFn4<Context<E, S>, T1, T2, T3, Output = Result<(), E>> + Send + Sync + 'static, F::OutputFuture: Send,