pub struct FileStore {
pub sess_path: String,
pub ses_file: String,
}
Fields§
§sess_path: String
§ses_file: String
Implementations§
source§impl FileStore
impl FileStore
sourcepub fn check_paths(&self) -> Result
pub fn check_paths(&self) -> Result
Create a new instance of FilesStore
pub fn get_path(&self, id: &str) -> Result<String>
pub fn get_session_id_path(&self, id_filename: &str) -> Result<String>
sourcepub async fn load_session_file(&self, id: &str) -> Result<Option<Session>>
pub async fn load_session_file(&self, id: &str) -> Result<Option<Session>>
As session Id from async_session
comes in base64 it will be not valid for OS filename
bin2hex
pass id to hex as bytes and from there to string or viceversa
pub async fn cleanup(&self) -> Result
pub async fn count(&self) -> usize
Trait Implementations§
source§impl SessionStore for FileStore
impl SessionStore for FileStore
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