pub trait Layer<In, P>where
    P: ContextOperator<In>,{
    type Operator: ContextOperator<In, Out = Self::Out>;
    type Out;

    // Required method
    fn layer(&self, operator: P) -> Self::Operator;
}
Expand description

Layer. Convert an ContextOperator to another ContextOperator

Required Associated Types§

source

type Operator: ContextOperator<In, Out = Self::Out>

The output operator.

source

type Out

The output type.

Required Methods§

source

fn layer(&self, operator: P) -> Self::Operator

Convert an In-operator to another In-operator.

Implementors§

source§

impl<F, In, P, P2> Layer<In, P> for LayerFn<F>where F: Fn(P) -> P2, P: ContextOperator<In>, P2: ContextOperator<In>,

§

type Operator = P2

§

type Out = <P2 as ContextOperator<In>>::Out

source§

impl<In, P, L> Layer<In, P> for OptionalLayer<L>where P: ContextOperator<In>, L: Layer<In, P>, L::Operator: ContextOperator<In, Out = P::Out>,

§

type Operator = Either<<L as Layer<In, P>>::Operator, P>

§

type Out = <P as ContextOperator<In>>::Out

source§

impl<P, In, Out> Layer<In, P> for BoxLayer<P, In, Out>where P: ContextOperator<In>,

§

type Operator = Box<dyn ContextOperator<In, Out = Out> + Send>

§

type Out = Out

source§

impl<T, I, P> Layer<I, P> for AddData<T>where P: ContextOperator<I>, T: Send + Sync + 'static,

§

type Operator = AddDataOperator<T, P>

§

type Out = <P as ContextOperator<I>>::Out

source§

impl<T, P> Layer<T, P> for Cachewhere P: ContextOperator<T>,

§

type Operator = CacheOperator<P>

§

type Out = <P as ContextOperator<T>>::Out

source§

impl<T, P> Layer<T, P> for Identity<T, P>where P: ContextOperator<T>,

§

type Operator = P

§

type Out = <P as ContextOperator<T>>::Out

source§

impl<T, P, F> Layer<T, P> for Inspect<F>where P: ContextOperator<T>, F: Fn(&T, &Context) + Clone,

§

type Operator = InspectOperator<P, F>

§

type Out = <P as ContextOperator<T>>::Out

source§

impl<T, P, Inner, Outer> Layer<T, P> for Stack<Inner, Outer>where P: ContextOperator<T>, Inner: Layer<T, P>, Outer: Layer<T, Inner::Operator>,

§

type Operator = <Outer as Layer<T, <Inner as Layer<T, P>>::Operator>>::Operator

§

type Out = <<Stack<Inner, Outer> as Layer<T, P>>::Operator as ContextOperator<T>>::Out

source§

impl<T, P, R, Env, Data, F> Layer<T, P> for InsertWithData<F>where P: ContextOperator<T>, F: Fn() -> R, R: for<'a> RefOperator<'a, T, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static,

source§

impl<T, P, R, Out, F> Layer<T, P> for Insert<F>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = Out>, Out: Send + Sync + 'static, F: Fn() -> R,

§

type Operator = InsertOperator<P, R>

§

type Out = <P as ContextOperator<T>>::Out

source§

impl<T, P, R, Out, F> Layer<T, P> for InsertData<F>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = Option<Out>>, Out: Send + Sync + 'static, F: Fn() -> R,

§

type Operator = InsertDataOperator<P, R>

§

type Out = <P as ContextOperator<T>>::Out

source§

impl<T, U, P, Builder, F> Layer<T, P> for Then<Builder>where P: ContextOperator<T>, Builder: Fn() -> F, F: FnMut(P::Out, &Context) -> U + Clone,

§

type Operator = ThenOperator<P, F>

§

type Out = U