pub struct State<S>(/* private fields */);Expand description
Shared application state passed to every request handler.
Wraps an Arc<S> for zero-allocation sharing across handlers. Handlers
receive a clone of this wrapper (not a clone of S), which only increments
the refcount. Dereferences transparently to &S.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for State<S>
impl<S> RefUnwindSafe for State<S>where
S: RefUnwindSafe,
impl<S> Send for State<S>
impl<S> Sync for State<S>
impl<S> Unpin for State<S>
impl<S> UnsafeUnpin for State<S>
impl<S> UnwindSafe for State<S>where
S: 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