pub struct PostgresStore { /* private fields */ }
Expand description
A PostgreSQL session store.
Implementations§
Source§impl PostgresStore
impl PostgresStore
Sourcepub fn new(pool: Pool) -> Self
pub fn new(pool: Pool) -> Self
Create a new PostgreSQL store with the provided connection pool.
Sourcepub fn with_schema_name(
self,
schema_name: impl AsRef<str>,
) -> Result<Self, String>
pub fn with_schema_name( self, schema_name: impl AsRef<str>, ) -> Result<Self, String>
Set the session table schema name with the provided name.
Trait Implementations§
Source§impl Clone for PostgresStore
impl Clone for PostgresStore
Source§fn clone(&self) -> PostgresStore
fn clone(&self) -> PostgresStore
Returns a duplicate 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 PostgresStore
impl Debug for PostgresStore
Source§impl ExpiredDeletion for PostgresStore
impl ExpiredDeletion for PostgresStore
Source§fn delete_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
A method for deleting expired sessions from the store.
Source§fn continuously_delete_expired<'async_trait>(
self,
period: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
fn continuously_delete_expired<'async_trait>(
self,
period: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
This function will keep running indefinitely, deleting expired rows and
then waiting for the specified period before deleting again. Read more
Source§impl SessionStore for PostgresStore
impl SessionStore for PostgresStore
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 mut Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 mut Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new session in the store with the provided session record. Read more
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Saves the provided session record to the store. Read more
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id,
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads an existing session record from the store using the provided ID. Read more
Auto Trait Implementations§
impl Freeze for PostgresStore
impl !RefUnwindSafe for PostgresStore
impl Send for PostgresStore
impl Sync for PostgresStore
impl Unpin for PostgresStore
impl !UnwindSafe for PostgresStore
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