Struct ThenOperator

Source
pub struct ThenOperator<P, F> { /* private fields */ }
Expand description

Operator that used to inspect the context.

Trait Implementations§

Source§

impl<T, U, P, F> ContextOperator<T> for ThenOperator<P, F>
where P: ContextOperator<T>, F: FnMut(P::Out, &Context) -> U,

Source§

type Out = U

The output type inside the Value wrapper.
Source§

fn next(&mut self, input: Value<T>) -> Value<Self::Out>

Apply the operator.

Auto Trait Implementations§

§

impl<P, F> Freeze for ThenOperator<P, F>
where P: Freeze, F: Freeze,

§

impl<P, F> RefUnwindSafe for ThenOperator<P, F>

§

impl<P, F> Send for ThenOperator<P, F>
where P: Send, F: Send,

§

impl<P, F> Sync for ThenOperator<P, F>
where P: Sync, F: Sync,

§

impl<P, F> Unpin for ThenOperator<P, F>
where P: Unpin, F: Unpin,

§

impl<P, F> UnwindSafe for ThenOperator<P, F>
where P: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, P> ContextOperatorExt<T> for P
where P: ContextOperator<T>,

Source§

fn boxed(self) -> BoxContextOperator<In, Self::Out>
where Self: Send + Sized + 'static,

Create a boxed ContextOperator.
Source§

fn with<L>(self, layer: L) -> L::Operator
where L: Layer<In, Self>, Self: Sized,

Add a layer.
Source§

fn finish(self) -> ContextedOperator<Self>
where Self: Sized,

Build into an operator without the Value wrapper.
Source§

fn finish_with_data(self, data: Map) -> ContextedOperator<Self>
where Self: Sized,

Build into an operator without the Value wrapper with the given data context.
Source§

fn cache(self, length: usize) -> CacheOperator<Self>
where Self: Sized,

Add a cache layer with the given length. Read more
Source§

fn insert_env<R, Out>(self, f: impl Fn() -> R) -> InsertOperator<Self, R>
where R: for<'a> RefOperator<'a, In, Output = Out>, Out: Send + Sync + 'static, Self: Sized,

Add a Insert layer with the given RefOperator constructor (i.e. a function that returns a RefOperator). Read more
Source§

fn insert_env_if<R, Out>( self, enable: bool, f: impl Fn() -> R, ) -> Either<InsertOperator<Self, R>, Self>
where R: for<'a> RefOperator<'a, In, Output = Out>, Out: Send + Sync + 'static, Self: Sized,

Optionally add a Insert layer with the given RefOperator constructor. Read more
Source§

fn insert_data<R, Out>(self, f: impl Fn() -> R) -> InsertDataOperator<Self, R>
where R: for<'a> RefOperator<'a, In, Output = Option<Out>>, Out: Send + Sync + 'static, Self: Sized,

Add a InsertData layer with the given RefOperator constructor. (i.e. a function that returns a RefOperator). Read more
Source§

fn insert_data_if<R, Out>( self, enable: bool, f: impl Fn() -> R, ) -> Either<InsertDataOperator<Self, R>, Self>
where R: for<'a> RefOperator<'a, In, Output = Option<Out>>, Out: Send + Sync + 'static, Self: Sized,

Optionally add a InsertData layer with the given RefOperator constructor. Read more
Source§

fn insert<R, Env, Data>( self, f: impl Fn() -> R, ) -> InsertWithDataOperator<Self, R>
where R: for<'a> RefOperator<'a, In, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static, Self: Sized,

Add a InsertWithData layer with the given RefOperator constructor. (i.e. a function that returns a RefOperator). Read more
Source§

fn insert_if<R, Env, Data>( self, enable: bool, f: impl Fn() -> R, ) -> Either<InsertWithDataOperator<Self, R>, Self>
where R: for<'a> RefOperator<'a, In, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static, Self: Sized,

Optionally add a InsertWithData layer with the given RefOperator constructor. Read more
Source§

fn inspect<F>(self, f: F) -> InspectOperator<Self, F>
where F: Fn(&In, &Context) + Clone, Self: Sized,

Add an inspect layer with the given closure.
Source§

fn provide<D>(self, data: D) -> AddDataOperator<D, Self>
where D: Clone + Send + Sync + 'static, Self: Sized,

Provide data to the context.
Source§

fn provide_if<D>( self, data: Option<D>, ) -> Either<AddDataOperator<D, Self>, Self>
where D: Clone + Send + Sync + 'static, Self: Sized,

Optionally provide data to the context. Read more
Source§

fn provide_with<D>( self, provider: impl Fn() -> Option<D> + Send + Sync + 'static, ) -> AddDataOperator<D, Self>
where D: Send + Sync + 'static, Self: Sized,

Provide data to the context with the given data provider.
Source§

fn provide_with_if<D>( self, enable: bool, provider: impl Fn() -> Option<D> + Send + Sync + 'static, ) -> Either<AddDataOperator<D, Self>, Self>
where D: Send + Sync + 'static, Self: Sized,

Optionally provide data to the context with the given data provider. Read more
Source§

fn from_context<D>(self) -> AddDataOperator<D, Self>
where D: Send + Sync + 'static, Self: Sized,

👎Deprecated: use data_from_context instead
Declare that the data of type D is in the context.
Source§

fn data_from_context<D>(self) -> AddDataOperator<D, Self>
where D: Send + Sync + 'static, Self: Sized,

Declare that the data of type D is in the data context.
Source§

fn then_with<Out, F, Builder>(self, builder: Builder) -> ThenOperator<Self, F>
where F: FnMut(Self::Out, &Context) -> Out + Clone, Builder: Fn() -> F, Self: Sized,

Add a closure that will be called when the inner operator is evaluated.
Source§

fn with_if<L>(self, layer: Option<L>) -> Either<L::Operator, Self>
where L: Layer<In, Self>, L::Operator: ContextOperator<In, Out = Self::Out>, Self: Sized,

Optionally add a layer.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.