Trait HandlerRef

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

Required Associated Types§

Required Methods§

Source

fn handle_ref( 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> HandlerRef<Context, Code, Input> for UseContext
where Context: HasAsyncErrorType + CanHandleRef<Code, Input>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl<Component, Context, Code, Input> HandlerRef<Context, Code, Input> for Component
where Context: HasAsyncErrorType, Component: DelegateComponent<HandlerRefComponent> + IsProviderFor<HandlerRefComponent, Context, (Code, Input)>, Component::Delegate: HandlerRef<Context, Code, Input>,

Source§

type Output = <<Component as DelegateComponent<HandlerRefComponent>>::Delegate as HandlerRef<Context, Code, Input>>::Output

Source§

impl<Context, Code, Input, Provider, Output> HandlerRef<Context, Code, Input> for PromoteRef<Provider>
where Context: HasAsyncErrorType, Provider: for<'a> Handler<Context, Code, &'a Input, Output = Output>, Code: Send, Input: Sync,

Source§

type Output = Output

Source§

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

Source§

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