Struct sessions_core::Session
source · [−]pub struct Session { /* private fields */ }
Expand description
Session
Implementations
sourceimpl Session
impl Session
sourcepub fn get<T>(&self, key: &str) -> Result<Option<T>, Error> where
T: DeserializeOwned,
pub fn get<T>(&self, key: &str) -> Result<Option<T>, Error> where
T: DeserializeOwned,
Gets a value by the key
sourcepub fn set<T>(&self, key: &str, val: T) -> Result<(), Error> where
T: Serialize,
pub fn set<T>(&self, key: &str, val: T) -> Result<(), Error> where
T: Serialize,
Sets a value by the key
sourcepub fn remove_as<T>(&self, key: &str) -> Option<T> where
T: DeserializeOwned,
pub fn remove_as<T>(&self, key: &str) -> Option<T> where
T: DeserializeOwned,
Removes a value and deserialize
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more