pub struct AppState { /* private fields */ }Expand description
Immutable, cheaply-cloneable application state produced by Registry::into_state.
AppState is the value passed to Router::with_state.
axum clones it for every request, so the underlying service map is wrapped in an
Arc and never copied.
Retrieve individual services inside handlers through the
Service<T> extractor, which calls
AppState::get internally.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
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