pub struct Session<T>(/* private fields */);Expand description
Implementations§
Source§impl<T> Session<T>
impl<T> Session<T>
pub fn get(&self) -> OptionSessionGuard<'_, T>
pub fn insert(&self, value: T) -> SessionGuard<'_, T>
pub fn get_or_insert(&self, value: T) -> SessionGuard<'_, T>
pub fn get_or_insert_with<F>(&self, f: F) -> SessionGuard<'_, T>where
F: FnOnce() -> T,
pub fn get_or_insert_default(&self) -> SessionGuard<'_, T>where
T: Default,
Trait Implementations§
Source§impl<S, T> FromRequestParts<S> for Session<T>
impl<S, T> FromRequestParts<S> for Session<T>
Source§type Rejection = SessionRejection
type Rejection = SessionRejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Auto Trait Implementations§
impl<T> Freeze for Session<T>
impl<T> !RefUnwindSafe for Session<T>
impl<T> Send for Session<T>where
T: Send,
impl<T> Sync for Session<T>where
T: Send,
impl<T> Unpin for Session<T>
impl<T> !UnwindSafe for Session<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.