pub struct StateRef<'a, S>(pub &'a S)
where
S: ?Sized;
Expand description
App state extractor. S type must be the same with the type passed to App::with_xxx_state(S).
Tuple Fields§
§0: &'a S
Trait Implementations§
Source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateRef<'a, T>where
C: BorrowState<T>,
T: ?Sized + 'static,
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateRef<'a, T>where
C: BorrowState<T>,
T: ?Sized + 'static,
Auto Trait Implementations§
impl<'a, S> Freeze for StateRef<'a, S>where
S: ?Sized,
impl<'a, S> RefUnwindSafe for StateRef<'a, S>where
S: RefUnwindSafe + ?Sized,
impl<'a, S> Send for StateRef<'a, S>
impl<'a, S> Sync for StateRef<'a, S>
impl<'a, S> Unpin for StateRef<'a, S>where
S: ?Sized,
impl<'a, S> UnwindSafe for StateRef<'a, S>where
S: RefUnwindSafe + ?Sized,
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