pub trait SessionExt {
// Required methods
fn session(&self) -> Session;
fn logout_other_sessions(&self) -> impl Future<Output = Result<u64>> + Send;
fn logout_all_sessions(
&mut self,
) -> impl Future<Output = Result<u64>> + Send;
// Provided methods
fn flash(&self, key: impl Into<String>, value: impl Into<String>) { ... }
fn flash_status(&self, msg: impl Into<String>) { ... }
fn flash_errors(&self, errors: &Value) { ... }
fn flash_old(&self, old: &Value) { ... }
}Expand description
Convenient access to the request Session (empty session if the layer is absent).
Required Methods§
fn session(&self) -> Session
Sourcefn logout_other_sessions(&self) -> impl Future<Output = Result<u64>> + Send
fn logout_other_sessions(&self) -> impl Future<Output = Result<u64>> + Send
Invalidate every other session for the bound user; keep the current cookie.
Requires Session::bind_user (done by Passport/Fortify login).
Provided Methods§
fn flash(&self, key: impl Into<String>, value: impl Into<String>)
fn flash_status(&self, msg: impl Into<String>)
fn flash_errors(&self, errors: &Value)
fn flash_old(&self, old: &Value)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".