Trait Handler

Source
pub trait Handler<Context, Code: Send, Input: Send>: IsProviderFor<HandlerComponent, Context, (Code, Input)>
where Context: HasAsyncErrorType,
{ type Output: Send; // Required method fn handle( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> impl Future<Output = Result<Self::Output, Context::Error>> + MaybeSend; }

Required Associated Types§

Required Methods§

Source

fn handle( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> impl Future<Output = Result<Self::Output, Context::Error>> + MaybeSend

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<Context, Code: Send, Input: Send> Handler<Context, Code, Input> for UseContext
where Context: HasAsyncErrorType + CanHandle<Code, Input>,

Source§

type Output = <Context as CanHandle<Code, Input>>::Output

Source§

async fn handle( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> Result<Self::Output, Context::Error>

Source§

impl<Context, Code: Send, Input: Send, __Components__, __Delegate__> Handler<Context, Code, Input> for UseDelegate<__Components__>
where Context: HasAsyncErrorType, __Components__: DelegateComponent<Code, Delegate = __Delegate__>, __Delegate__: Handler<Context, Code, Input>,

Source§

type Output = <__Delegate__ as Handler<Context, Code, Input>>::Output

Source§

async fn handle( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> Result<Self::Output, Context::Error>

Implementors§

Source§

impl<Component, Context, Code: Send, Input: Send> Handler<Context, Code, Input> for Component
where Context: HasAsyncErrorType, Component: DelegateComponent<HandlerComponent> + IsProviderFor<HandlerComponent, Context, (Code, Input)>, Component::Delegate: Handler<Context, Code, Input>,

Source§

type Output = <<Component as DelegateComponent<HandlerComponent>>::Delegate as Handler<Context, Code, Input>>::Output

Source§

impl<Context, Code, Input, Output, CurrentProvider, RestProviders> Handler<Context, Code, Input> for PipeHandlers<Cons<CurrentProvider, RestProviders>>
where Context: HasAsyncErrorType, CurrentProvider: Handler<Context, Code, Input>, PipeHandlers<RestProviders>: Handler<Context, Code, CurrentProvider::Output, Output = Output>, Code: Send, Input: Send, Output: Send,

Source§

type Output = Output

Source§

impl<Context, Code, Input, Output, Provider> Handler<Context, Code, Input> for Promote<Provider>
where Context: HasAsyncErrorType, Provider: Computer<Context, Code, Input, Output = Output>, Code: Send, Input: Send, Output: Send,

Source§

type Output = Output

Source§

impl<Context, Code, Input, Output, Provider> Handler<Context, Code, Input> for TryPromote<Provider>
where Context: HasAsyncErrorType, Provider: Computer<Context, Code, Input, Output = Result<Output, Context::Error>>, Code: Send, Input: Send, Output: Send,

Source§

type Output = Output

Source§

impl<Context, Code: Send, Input: Send, __Components__, __Delegate__> Handler<Context, Code, Input> for UseInputDelegate<__Components__>
where Context: HasAsyncErrorType, __Components__: DelegateComponent<Input, Delegate = __Delegate__>, __Delegate__: Handler<Context, Code, Input>,

Source§

type Output = <__Delegate__ as Handler<Context, Code, Input>>::Output

Source§

impl<Context, Tag, Input> Handler<Context, Tag, Input> for PipeHandlers<Nil>
where Context: HasAsyncErrorType, Tag: Send, Input: Send,

Source§

type Output = Input