pub trait SessionStorage:
Send
+ Sync
+ Debug {
// Required methods
fn save_session<'life0, 'async_trait>(
&'life0 self,
session: CompilerSession,
) -> Pin<Box<dyn Future<Output = Result<CompilerSession>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Option<CompilerSession>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompilerSession>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Storage abstraction for compiler sessions.
Reads and deletes take the verified CompilerOwner; a session that belongs
to another owner is indistinguishable from an absent one. save_session
persists the owner carried by the session itself.
Required Methods§
Sourcefn save_session<'life0, 'async_trait>(
&'life0 self,
session: CompilerSession,
) -> Pin<Box<dyn Future<Output = Result<CompilerSession>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_session<'life0, 'async_trait>(
&'life0 self,
session: CompilerSession,
) -> Pin<Box<dyn Future<Output = Result<CompilerSession>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save or update a session.
Sourcefn get_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Option<CompilerSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Option<CompilerSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve a session by ID if owner owns it.
Sourcefn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner: &'life2 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a session owner owns.
Sourcefn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompilerSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 CompilerOwner,
) -> Pin<Box<dyn Future<Output = Result<Vec<CompilerSession>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List the sessions owner owns.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".