pub struct InsertWithDataOperator<P, R> { /* private fields */ }
Expand description

Operator that inserts a value into the data context.

Trait Implementations§

source§

impl<T, P, R, Env, Data> Operator<Value<T>> for InsertWithDataOperator<P, R>where P: ContextOperator<T>, R: for<'a> RefOperator<'a, T, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static,

§

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

Output type.
source§

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

Produce the next output.

Auto Trait Implementations§

§

impl<P, R> RefUnwindSafe for InsertWithDataOperator<P, R>where P: RefUnwindSafe, R: RefUnwindSafe,

§

impl<P, R> Send for InsertWithDataOperator<P, R>where P: Send, R: Send,

§

impl<P, R> Sync for InsertWithDataOperator<P, R>where P: Sync, R: Sync,

§

impl<P, R> Unpin for InsertWithDataOperator<P, R>where P: Unpin, R: Unpin,

§

impl<P, R> UnwindSafe for InsertWithDataOperator<P, R>where P: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<In, P, Out> ContextOperator<In> for Pwhere P: Operator<Value<In>, Output = Value<Out>>,

§

type Out = Out

The output type inside the Value wrapper.
source§

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

Apply the operator.
source§

impl<T, P> ContextOperatorExt<T> for Pwhere 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::Operatorwhere 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 Twhere 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<I, T> OperatorExt<I> for Twhere T: Operator<I>,

source§

fn then<P2>(self, other: P2) -> Then<I, Self, P2>where Self: Sized, P2: Operator<Self::Output>,

Combine with another operator that uses Self::Output as input type. Read more
source§

fn facet<P2>(self, other: P2) -> Facet<I, Self, P2>where Self: Sized, P2: Operator<I>,

Combine with another operator with the same input type. Read more
source§

fn map<O, F>(self, f: F) -> Then<I, Self, Map<F>>where Self: Sized, F: FnMut(Self::Output) -> O,

Map the output after performing the operator.
source§

fn boxed<'a>(self) -> BoxOperator<'a, I, Self::Output>where Self: Sized + Send + 'a,

Convert into a BoxOperator.
source§

fn boxed_local<'a>(self) -> LocalBoxOperator<'a, I, Self::Output>where Self: Sized + 'a,

Convert into a LocalBoxOperator.
source§

fn into_async_operator(self) -> Next<Self>where Self: Sized,

Convert into a [AsyncOperator].
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

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

§

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 Twhere U: TryFrom<T>,

§

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.