pub struct DatabaseSessionStore { /* private fields */ }Implementations§
source§impl DatabaseSessionStore
impl DatabaseSessionStore
sourcepub fn new(connection: DatabaseConnection) -> DatabaseSessionStore
pub fn new(connection: DatabaseConnection) -> DatabaseSessionStore
Create a new DatabaseSessionStore from the given DatabaseConnection.
Example
use async_sea_orm_session::DatabaseSessionStore;
use sea_orm::{Database, DatabaseConnection};
let db: DatabaseConnection =
Database::connect("protocol://username:password@host/database").await?;
// Make a `DatabaseSessionStore` which reuses the underlying connection pool:
let store = DatabaseSessionStore::new(db.clone());
// Alternatively if you don't mind moving `db` you can do:
let store = DatabaseSessionStore::new(db);Trait Implementations§
source§impl Clone for DatabaseSessionStore
impl Clone for DatabaseSessionStore
source§fn clone(&self) -> DatabaseSessionStore
fn clone(&self) -> DatabaseSessionStore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for DatabaseSessionStore
impl Debug for DatabaseSessionStore
source§impl SessionStore for DatabaseSessionStore
impl SessionStore for DatabaseSessionStore
source§fn load_session<'life0, 'async_trait>(
&'life0 self,
cookie_value: String
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_session<'life0, 'async_trait>(
&'life0 self,
cookie_value: String
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a session from the storage backend. Read more
source§fn store_session<'life0, 'async_trait>(
&'life0 self,
session: Session
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_session<'life0, 'async_trait>(
&'life0 self,
session: Session
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a session on the storage backend. Read more