pub struct State<S>(/* private fields */);
Expand description
An extractor that extracts the state of the application.
Trait Implementations§
§impl<OuterState, InnerState> FromRequestParts<OuterState> for State<InnerState>
impl<OuterState, InnerState> FromRequestParts<OuterState> for State<InnerState>
§type Rejection = Infallible
type Rejection = Infallible
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
§fn from_request_parts<'a, 'b, 'c>(
_: &'a mut Parts,
state: &'b OuterState
) -> Pin<Box<dyn Future<Output = Result<State<InnerState>, <State<InnerState> as FromRequestParts<OuterState>>::Rejection>> + Send + 'c>>where
'a: 'c,
'b: 'c,
State<InnerState>: 'c,
fn from_request_parts<'a, 'b, 'c>(
_: &'a mut Parts,
state: &'b OuterState
) -> Pin<Box<dyn Future<Output = Result<State<InnerState>, <State<InnerState> as FromRequestParts<OuterState>>::Rejection>> + Send + 'c>>where
'a: 'c,
'b: 'c,
State<InnerState>: 'c,
Perform the extraction.
impl<S> Copy for State<S>where
S: Copy,
Auto Trait Implementations§
impl<S> Freeze for State<S>where
S: Freeze,
impl<S> RefUnwindSafe for State<S>where
S: RefUnwindSafe,
impl<S> Send for State<S>where
S: Send,
impl<S> Sync for State<S>where
S: Sync,
impl<S> Unpin for State<S>where
S: Unpin,
impl<S> UnwindSafe for State<S>where
S: 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
§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.