pub struct Inspect<F>(pub F);
Expand description
Layer that used to inspect the context.
Tuple Fields§
§0: F
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Inspect<F>where
F: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<In, P, L> LayerExt<In, P> for Lwhere
P: ContextOperator<In>,
L: Layer<In, P>,
impl<In, P, L> LayerExt<In, P> for Lwhere
P: ContextOperator<In>,
L: Layer<In, P>,
Source§fn with<Outer>(self, outer: Outer) -> Stack<Self, Outer>
fn with<Outer>(self, outer: Outer) -> Stack<Self, Outer>
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,
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 moreSource§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,
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,
Source§fn insert_data<R, Out, F>(self, f: F) -> Stack<Self, InsertData<F>>
fn insert_data<R, Out, F>(self, f: F) -> Stack<Self, InsertData<F>>
Add a
InsertData
layer with the given RefOperator
constructor.
(i.e. a function that returns a RefOperator
). Read moreSource§fn insert_data_if<R, Out, F>(
self,
enable: bool,
f: F,
) -> Stack<Self, OptionalLayer<InsertData<F>>>
fn insert_data_if<R, Out, F>( self, enable: bool, f: F, ) -> Stack<Self, OptionalLayer<InsertData<F>>>
Source§fn insert<R, Env, Data, F>(self, f: F) -> Stack<Self, InsertWithData<F>>
fn insert<R, Env, Data, F>(self, f: F) -> Stack<Self, InsertWithData<F>>
Add a
InsertWithData
layer with the given RefOperator
constructor.
(i.e. a function that returns a RefOperator
). Read moreSource§fn insert_if<R, Env, Data, F>(
self,
enable: bool,
f: F,
) -> Stack<Self, OptionalLayer<InsertWithData<F>>>
fn insert_if<R, Env, Data, F>( self, enable: bool, f: F, ) -> Stack<Self, OptionalLayer<InsertWithData<F>>>
Source§fn inspect<F>(self, f: F) -> Stack<Self, Inspect<F>>
fn inspect<F>(self, f: F) -> Stack<Self, Inspect<F>>
Add an inspect layer with the given closure.
Source§fn provide_if<D>(
self,
data: Option<D>,
) -> Stack<Self, OptionalLayer<AddData<D>>>
fn provide_if<D>( self, data: Option<D>, ) -> Stack<Self, OptionalLayer<AddData<D>>>
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>>
fn provide_with<D>( self, provider: impl Fn() -> Option<D> + Send + Sync + 'static, ) -> Stack<Self, AddData<D>>
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>>>
fn provide_with_if<D>( self, enable: bool, provider: impl Fn() -> Option<D> + Send + Sync + 'static, ) -> Stack<Self, OptionalLayer<AddData<D>>>
Optionally provide data to the context with the given data provider. Read more
Source§fn from_context<D>(self) -> Stack<Self, AddData<D>>
fn from_context<D>(self) -> Stack<Self, AddData<D>>
👎Deprecated: use
data_from_context
insteadDeclare that the data of type
D
is in the context.Source§fn data_from_context<D>(self) -> Stack<Self, AddData<D>>
fn data_from_context<D>(self) -> Stack<Self, AddData<D>>
Declare that the data of type
D
is in the data context.