Trait Computer

Source
pub trait Computer<Context, Code, Input>: IsProviderFor<ComputerComponent, Context, (Code, Input)> {
    type Output;

    // Required method
    fn compute(
        context: &Context,
        _tag: PhantomData<Code>,
        input: Input,
    ) -> Self::Output;
}

Required Associated Types§

Required Methods§

Source

fn compute( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> Self::Output

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> Computer<Context, Code, Input> for UseContext
where Context: CanCompute<Code, Input>,

Source§

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

Source§

fn compute( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> Self::Output

Source§

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

Source§

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

Source§

fn compute( context: &Context, _tag: PhantomData<Code>, input: Input, ) -> Self::Output

Implementors§

Source§

impl<Component, Context, Code, Input> Computer<Context, Code, Input> for Component
where Component: DelegateComponent<ComputerComponent> + IsProviderFor<ComputerComponent, Context, (Code, Input)>, Component::Delegate: Computer<Context, Code, Input>,

Source§

type Output = <<Component as DelegateComponent<ComputerComponent>>::Delegate as Computer<Context, Code, Input>>::Output

Source§

impl<Context, Tag, Input> Computer<Context, Tag, Input> for PipeHandlers<Nil>

Source§

type Output = Input

Source§

impl<Context, Tag, Input, Output, CurrentProvider, RestProviders> Computer<Context, Tag, Input> for PipeHandlers<Cons<CurrentProvider, RestProviders>>
where CurrentProvider: Computer<Context, Tag, Input>, PipeHandlers<RestProviders>: Computer<Context, Tag, CurrentProvider::Output, Output = Output>,

Source§

type Output = Output