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>where
K: AsRef<str>,
V: Serialize,
pub async fn set<K, V>(&mut self, key: K, value: &V) -> Result<(), SessionError>where K: AsRef<str>, V: Serialize,
Sets a value for key
sourcepub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>where
K: AsRef<str>,
O: DeserializeOwned,
pub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>where K: AsRef<str>, O: DeserializeOwned,
Gets a value for key
Trait Implementations§
Auto Trait Implementations§
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