pub trait FileBackend: Send + Sync {
// Required methods
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_with_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
entries: &'life2 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<MemoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_container<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<StorageContainer>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn path(&self) -> &Path;
// Provided method
fn version(&self) -> u32 { ... }
}Expand description
File backend trait for session persistence
Required Methods§
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
entries: &'life1 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save entries to file with atomic write
Sourcefn save_with_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
entries: &'life2 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_with_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
entries: &'life2 [MemoryEntry],
) -> Pin<Box<dyn Future<Output = Layer3Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Save with session ID for container
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load entries from file
Sourcefn load_container<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<StorageContainer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_container<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<StorageContainer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load full storage container
Sourcefn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if backend file exists
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".