pub struct State<T>(pub Arc<T>);Expand description
Extractor wrapper for shared application state.
Tuple Fields§
§0: Arc<T>Trait Implementations§
Source§impl<T> FromRequest<T> for State<T>
impl<T> FromRequest<T> for State<T>
type Rejection = Infallible
async fn from_request( _ctx: &mut RequestContext, state: &Arc<T>, ) -> Result<Self, Self::Rejection>
Auto Trait Implementations§
impl<T> Freeze for State<T>
impl<T> RefUnwindSafe for State<T>where
T: RefUnwindSafe,
impl<T> Send for State<T>
impl<T> Sync for State<T>
impl<T> Unpin for State<T>
impl<T> UnwindSafe for State<T>where
T: RefUnwindSafe,
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