Trait Producer

Source
pub trait Producer<Context, Code>: IsProviderFor<ProducerComponent, Context, Code> {
    type Output;

    // Required method
    fn produce(context: &Context, _code: PhantomData<Code>) -> Self::Output;
}

Required Associated Types§

Required Methods§

Source

fn produce(context: &Context, _code: PhantomData<Code>) -> 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> Producer<Context, Code> for UseContext
where Context: CanProduce<Code>,

Source§

type Output = <Context as CanProduce<Code>>::Output

Source§

fn produce(context: &Context, _code: PhantomData<Code>) -> Self::Output

Source§

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

Source§

type Output = <__Delegate__ as Producer<Context, Code>>::Output

Source§

fn produce(context: &Context, _code: PhantomData<Code>) -> Self::Output

Implementors§

Source§

impl<Component, Context, Code> Producer<Context, Code> for Component
where Component: DelegateComponent<ProducerComponent> + IsProviderFor<ProducerComponent, Context, Code>, Component::Delegate: Producer<Context, Code>,

Source§

type Output = <<Component as DelegateComponent<ProducerComponent>>::Delegate as Producer<Context, Code>>::Output