pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
pub fn new() -> Self
pub fn from_data( data: HashMap<String, String>, flash_new: HashMap<String, String>, csrf_token: String, ) -> Self
pub fn id(&self) -> &str
pub fn csrf_token(&self) -> &str
pub fn regenerate(&mut self)
pub fn regenerate_csrf(&mut self)
pub fn put(&mut self, key: &str, value: &str)
pub fn get(&self, key: &str) -> Option<&str>
pub fn forget(&mut self, key: &str)
pub fn flush(&mut self)
pub fn all(&self) -> &HashMap<String, String>
pub fn flash(&mut self, key: &str, value: &str)
pub fn get_flash(&self, key: &str) -> Option<&str>
pub fn reflash(&mut self)
pub fn keep(&mut self, keys: &[&str])
pub fn all_flash(&self) -> (&HashMap<String, String>, &HashMap<String, String>)
pub fn to_payload(&self) -> String
pub fn from_payload(payload: &str) -> Option<Self>
pub fn has(&self, key: &str) -> bool
pub fn is_modified(&self) -> bool
pub fn pull(&mut self, key: &str) -> Option<String>
pub fn increment(&mut self, key: &str, by: i64) -> i64
pub fn decrement(&mut self, key: &str, by: i64) -> i64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Event for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more