pub trait StorageManager {
// Required methods
fn get_storage_items<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageItem>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_storage_item<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remove_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn clear_storage<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_storage_length<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Storage manager trait for localStorage and sessionStorage operations
Required Methods§
Sourcefn get_storage_items<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_storage_items<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageItem>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets all items from the specified storage type
Sourcefn get_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets a specific item from storage by key
Sourcefn set_storage_item<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_storage_item<'life0, 'life1, 'life2, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sets an item in storage
Sourcefn remove_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_storage_item<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes an item from storage by key
Sourcefn clear_storage<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_storage<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears all items from the specified storage type
Sourcefn get_storage_length<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_storage_length<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
storage_type: StorageType,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the number of items in storage
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.