pub struct AppWithState<S> { /* private fields */ }Expand description
An Application that combines user-defined state-aware routes with the
built-in App controller chain as a fallback.
Routes are matched in registration order. The first match wins; unmatched
requests are forwarded to App (static files, health probes, etc.).
Implementations§
Source§impl<S: Send + Sync + 'static> AppWithState<S>
impl<S: Send + Sync + 'static> AppWithState<S>
Sourcepub fn new(state: S) -> Self
pub fn new(state: S) -> Self
Create a new AppWithState wrapping state.
state is stored behind an Arc so it can be shared across threads
without cloning. Register routes with the builder methods.
Trait Implementations§
Source§impl<S: Send + Sync + 'static> Application for AppWithState<S>
impl<S: Send + Sync + 'static> Application for AppWithState<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for AppWithState<S>
impl<S> !UnwindSafe for AppWithState<S>
impl<S> Freeze for AppWithState<S>
impl<S> Send for AppWithState<S>
impl<S> Sync for AppWithState<S>
impl<S> Unpin for AppWithState<S>
impl<S> UnsafeUnpin for AppWithState<S>
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