Trait Handler

Source
pub trait Handler<Context, Code, Input>: IsProviderFor<HandlerComponent, Context, (Code, Input)>
where Context: HasAsyncErrorType,
{ type Output; // 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, Input> Handler<Context, Code, Input> for UseContext
where Context: HasAsyncErrorType + CanHandle<Code, Input>,

Source§

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

Source§

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

Source§

impl<Context, Code, Input, __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§

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

Implementors§

Source§

impl<Component, Context, Code, Input> 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, Error, Provider> Handler<Context, Code, Input> for TryPromote<Provider>
where Context: CanRaiseAsyncError<Error>, Provider: Computer<Context, Code, Input, Output = Result<Output, Error>>, Code: Send, Input: Send, Output: Send, Error: Send,

Source§

type Output = Output

Source§

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

Source§

type Output = Output

Source§

impl<Context, Code, Input, Output, Providers> Handler<Context, Code, Input> for PipeHandlers<Providers>
where Context: HasAsyncErrorType, Providers: PipeHandler<Context, Code, Input, Output = Output>, Code: Send, Input: Send, Output: Send,

Source§

type Output = Output

Source§

impl<Context, Code, Input, Target, Provider> Handler<Context, Code, Input> for PromoteRef<Provider>
where Context: HasAsyncErrorType, Provider: HandlerRef<Context, Code, Target>, Input: Deref<Target = Target> + Async, Code: Send,

Source§

type Output = <Provider as HandlerRef<Context, Code, Target>>::Output

Source§

impl<Context, Code, Input, __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, Code: Send, Input: Send> Handler<Context, Code, Input> for ReturnInput
where Context: HasAsyncErrorType,

Source§

type Output = Input

Source§

impl<Context, Code: Send, Tag: Send, Input: Send, Provider> Handler<Context, Code, ω<Tag, Input>> for HandleFieldValue<Provider>
where Context: HasAsyncErrorType, Provider: Handler<Context, Code, Input>,

Source§

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