Struct axum_starter::StateCollector
source · pub struct StateCollector(/* private fields */);
Expand description
collect all state during prepare
Implementations§
source§impl StateCollector
impl StateCollector
sourcepub fn insert<T: 'static + Any>(&mut self, data: T)
pub fn insert<T: 'static + Any>(&mut self, data: T)
insert a new type into state collect
if the type previously exist, the new value will overwrite the old one
sourcepub fn take<T: 'static + Any>(&mut self) -> Result<T, TypeNotInState>
pub fn take<T: 'static + Any>(&mut self) -> Result<T, TypeNotInState>
take a type from the collector
if the Value Not exist in collector, it will return TypeNotInState Error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StateCollector
impl !RefUnwindSafe for StateCollector
impl !Send for StateCollector
impl !Sync for StateCollector
impl Unpin for StateCollector
impl !UnwindSafe for StateCollector
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<'r, C, T1, T2, T3> Provider<'r, (T1, T2, T3)> for C
impl<'r, C, T1, T2, T3> Provider<'r, (T1, T2, T3)> for C
fn provide(&'r self) -> (T1, T2, T3)
source§impl<'r, C, T1, T2, T3, T4> Provider<'r, (T1, T2, T3, T4)> for C
impl<'r, C, T1, T2, T3, T4> Provider<'r, (T1, T2, T3, T4)> for C
fn provide(&'r self) -> (T1, T2, T3, T4)
source§impl<'r, C, T1, T2, T3, T4, T5> Provider<'r, (T1, T2, T3, T4, T5)> for C
impl<'r, C, T1, T2, T3, T4, T5> Provider<'r, (T1, T2, T3, T4, T5)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5)
source§impl<'r, C, T1, T2, T3, T4, T5, T6> Provider<'r, (T1, T2, T3, T4, T5, T6)> for C
impl<'r, C, T1, T2, T3, T4, T5, T6> Provider<'r, (T1, T2, T3, T4, T5, T6)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5, T6)
source§impl<'r, C, T1, T2, T3, T4, T5, T6, T7> Provider<'r, (T1, T2, T3, T4, T5, T6, T7)> for C
impl<'r, C, T1, T2, T3, T4, T5, T6, T7> Provider<'r, (T1, T2, T3, T4, T5, T6, T7)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5, T6, T7)
source§impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8)> for C
impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5, T6, T7, T8)
source§impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8, T9> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> for C
impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8, T9> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5, T6, T7, T8, T9)
source§impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for C
impl<'r, C, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Provider<'r, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for C
fn provide(&'r self) -> (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.