pub struct ContextBuilder { /* private fields */ }Implementations§
Source§impl ContextBuilder
impl ContextBuilder
pub fn config(self, config: Config) -> Self
Sourcepub fn state<T: Send + Sync + 'static>(self, value: T) -> Self
pub fn state<T: Send + Sync + 'static>(self, value: T) -> Self
Register a service. One value per type; registering twice replaces.
Sourcepub fn has_state<T: Send + Sync + 'static>(&self) -> bool
pub fn has_state<T: Send + Sync + 'static>(&self) -> bool
Whether something of this type has already been registered.
For the case where the framework would otherwise supply a default and
quietly replace what the application built for itself — see how App
decides whether to construct a view engine.
pub fn build(self) -> Context
Auto Trait Implementations§
impl !RefUnwindSafe for ContextBuilder
impl !UnwindSafe for ContextBuilder
impl Freeze for ContextBuilder
impl Send for ContextBuilder
impl Sync for ContextBuilder
impl Unpin for ContextBuilder
impl UnsafeUnpin for ContextBuilder
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