pub trait SessionSlot: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GrabResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 Value,
) -> Pin<Box<dyn Future<Output = GrabResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_cart<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GrabResult<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_cart<'life0, 'life1, 'async_trait>(
&'life0 self,
cart: Option<&'life1 Value>,
) -> Pin<Box<dyn Future<Output = GrabResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
An account’s session, wherever the service keeps it (sealed, ideally): read and written only through this (the client’s refreshes save here).
Required Methods§
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GrabResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GrabResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The session (none: not connected).
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 Value,
) -> Pin<Box<dyn Future<Output = GrabResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 Value,
) -> Pin<Box<dyn Future<Output = GrabResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Keep the session (a refresh renewed it).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".