pub struct Session<B> { /* private fields */ }
Expand description
Actual session
Implementations§
source§impl<B> Session<B>where
B: SessionBackend,
impl<B> Session<B>where
B: SessionBackend,
sourcepub async fn set<K, V>(&mut self, key: K, value: &V) -> Result<(), SessionError>
pub async fn set<K, V>(&mut self, key: K, value: &V) -> Result<(), SessionError>
Sets a value for key
sourcepub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>
pub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>
Gets a value for key
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Session<B>
impl<B> !RefUnwindSafe for Session<B>
impl<B> Send for Session<B>where
B: Send,
impl<B> Sync for Session<B>where
B: Send,
impl<B> Unpin for Session<B>
impl<B> !UnwindSafe for Session<B>
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