pub struct Session<Store: SessionStore + 'static>(/* private fields */);Implementations§
Source§impl<Store: SessionStore + 'static> Session<Store>
impl<Store: SessionStore + 'static> Session<Store>
pub fn session_key(&self) -> Option<SessionKey>
pub fn csrf_token(&self) -> Option<String>
pub fn contains_in_guest_zone(&self, key: &str) -> bool
pub fn contains_in_user_zone(&self, key: &str) -> bool
pub fn contains_in_debug_zone(&self, key: &str) -> bool
pub fn get_from_guest_zone<T: DeserializeOwned>( &self, key: &str, ) -> Result<Option<T>>
pub fn get_from_user_zone<T: DeserializeOwned>( &self, key: &str, ) -> Result<Option<T>>
pub fn get_from_debug_zone<T: DeserializeOwned>( &self, key: &str, ) -> Result<Option<T>>
pub fn keys_of_guest_zone(&self) -> Vec<String>
pub fn keys_of_user_zone(&self) -> Vec<String>
pub fn keys_of_debug_zone(&self) -> Vec<String>
pub fn status(&self) -> SessionStatus
pub async fn update<F, R>(&self, f: F) -> Result<R>
pub async fn purge(&self) -> Result<()>
Sourcepub async fn renew<F, R>(&self, f: F) -> Result<R>
pub async fn renew<F, R>(&self, f: F) -> Result<R>
Update session key. The old session will not be deleted for the following reasons:
- If there are simultaneous accesses, the access that comes after the renew will create a new session and cancel the previous cookie.
- Consider cases where modified cookies cannot be received due to communication errors.
Thus, since previous session data is not deleted, RENEW should not be used for logout.
pub async fn reset(&self)
pub async fn load(&self, key: &str) -> Result<()>
Trait Implementations§
Source§impl<Store: SessionStore + 'static> Debug for Session<Store>
impl<Store: SessionStore + 'static> Debug for Session<Store>
Source§impl<Store: SessionStore + 'static> FromRequest for Session<Store>
impl<Store: SessionStore + 'static> FromRequest for Session<Store>
Source§fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
Create a
Self from request parts asynchronously.Auto Trait Implementations§
impl<Store> Freeze for Session<Store>
impl<Store> RefUnwindSafe for Session<Store>
impl<Store> Send for Session<Store>
impl<Store> Sync for Session<Store>
impl<Store> Unpin for Session<Store>
impl<Store> UnwindSafe for Session<Store>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.