pub struct Inspect<F>(pub F);
Expand description

Layer that used to inspect the context.

Tuple Fields§

§0: F

Trait Implementations§

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>

The output operator.
§

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

The output type.
source§

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

Convert an In-operator to another In-operator.

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for Inspect<F>where F: RefUnwindSafe,

§

impl<F> Send for Inspect<F>where F: Send,

§

impl<F> Sync for Inspect<F>where F: Sync,

§

impl<F> Unpin for Inspect<F>where F: Unpin,

§

impl<F> UnwindSafe for Inspect<F>where F: 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<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<In, P, L> LayerExt<In, P> for Lwhere P: ContextOperator<In>, L: Layer<In, P>,

source§

fn boxed(self) -> BoxLayer<P, In, Self::Out>where Self: Sized + Send + Sync + 'static, Self::Operator: Send + 'static,

Create a boxed Layer.
source§

fn with<Outer>(self, outer: Outer) -> Stack<Self, Outer>where Outer: Layer<In, Self::Operator>, Self: Sized,

Stack a outer layer on top of the inner layer.
source§

fn insert_env<R, Out, F>(self, f: F) -> Stack<Self, Insert<F>>where F: Fn() -> R, 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, F>( self, enable: bool, f: F ) -> Stack<Self, OptionalLayer<Insert<F>>>where F: Fn() -> R, R: for<'a> RefOperator<'a, In, Output = Out>, Out: Send + Sync + 'static, Self: Sized,

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

fn insert_data<R, Out, F>(self, f: F) -> Stack<Self, InsertData<F>>where F: Fn() -> R, 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, F>( self, enable: bool, f: F ) -> Stack<Self, OptionalLayer<InsertData<F>>>where F: Fn() -> R, R: for<'a> RefOperator<'a, In, Output = Option<Out>>, Out: Send + Sync + 'static, Self: Sized,

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

fn insert<R, Env, Data, F>(self, f: F) -> Stack<Self, InsertWithData<F>>where F: Fn() -> R, 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, F>( self, enable: bool, f: F ) -> Stack<Self, OptionalLayer<InsertWithData<F>>>where F: Fn() -> R, R: for<'a> RefOperator<'a, In, Output = (Env, Option<Data>)>, Env: Send + Sync + 'static, Data: Send + Sync + 'static, Self: Sized,

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

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

Add an inspect layer with the given closure.
source§

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

Provide data to the context.
source§

fn provide_if<D>( self, data: Option<D> ) -> Stack<Self, OptionalLayer<AddData<D>>>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 ) -> Stack<Self, AddData<D>>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 ) -> Stack<Self, OptionalLayer<AddData<D>>>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) -> Stack<Self, AddData<D>>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) -> Stack<Self, AddData<D>>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 ) -> Stack<Self, Then<Builder>>where Builder: Fn() -> F, F: FnMut(Self::Out, &Context) -> Out + Clone, Self: Sized,

Add a closure that will be called after the operator is evaluated.
source§

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

Optionally add a layer.
§

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.