pub trait ClientFolderStorage:
StorageEventLogs<Error = Error>
+ ClientBaseStorage
+ ClientVaultStorage {
Show 20 methods
// Required methods
fn folders(&self) -> &HashMap<VaultId, Folder>;
fn folders_mut(&mut self) -> &mut HashMap<VaultId, Folder>;
fn read_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_login_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn current_folder(&self) -> Option<Summary>;
fn open_folder(&self, folder_id: &VaultId) -> Result<ReadEvent, Error>;
fn close_folder(&self);
// Provided methods
fn read_device_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vault>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn list_folders(&self) -> &[Summary] { ... }
fn find_folder(&self, vault: &FolderRef) -> Option<&Summary> { ... }
fn find<F>(&self, predicate: F) -> Option<&Summary>
where F: FnMut(&&Summary) -> bool { ... }
fn update_vault<'life0, 'life1, 'async_trait>(
&'life0 mut self,
vault: &'life1 Vault,
events: Vec<WriteEvent>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<&[Summary], Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn remove_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn import_folder_patches<'life0, 'async_trait>(
&'life0 mut self,
patches: HashMap<VaultId, FolderPatch>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn compact_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
key: &'life2 AccessKey,
) -> Pin<Box<dyn Future<Output = Result<AccountEvent, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn rename_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
name: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn update_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn description<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn set_description<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
description: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<WriteEvent, Error>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Folder management for client storage.
Required Methods§
Sourcefn folders_mut(&mut self) -> &mut HashMap<VaultId, Folder>
fn folders_mut(&mut self) -> &mut HashMap<VaultId, Folder>
Mutable in-memory folders.
Sourcefn read_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a vault from the storage.
Sourcefn read_login_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_login_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vault, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read the login vault from the storage.
Sourcefn current_folder(&self) -> Option<Summary>
fn current_folder(&self) -> Option<Summary>
Currently open folder.
Sourcefn open_folder(&self, folder_id: &VaultId) -> Result<ReadEvent, Error>
fn open_folder(&self, folder_id: &VaultId) -> Result<ReadEvent, Error>
Mark a folder as the currently open folder.
Sourcefn close_folder(&self)
fn close_folder(&self)
Close the current open folder.
Provided Methods§
Sourcefn read_device_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vault>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn read_device_vault<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vault>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Read the device vault from the storage.
Sourcefn list_folders(&self) -> &[Summary]
fn list_folders(&self) -> &[Summary]
List the in-memory folders.
Sourcefn find_folder(&self, vault: &FolderRef) -> Option<&Summary>
fn find_folder(&self, vault: &FolderRef) -> Option<&Summary>
Find a folder in this storage by reference.
Sourcefn find<F>(&self, predicate: F) -> Option<&Summary>
fn find<F>(&self, predicate: F) -> Option<&Summary>
Find a folder in this storage using a predicate.
Sourcefn update_vault<'life0, 'life1, 'async_trait>(
&'life0 mut self,
vault: &'life1 Vault,
events: Vec<WriteEvent>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_vault<'life0, 'life1, 'async_trait>(
&'life0 mut self,
vault: &'life1 Vault,
events: Vec<WriteEvent>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing vault by replacing it with a new vault.
Sourcefn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<&[Summary], Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<&[Summary], Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Read folders from storage and create the in-memory event logs for each folder.
Sourcefn remove_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a folder from memory.
Sourcefn import_folder_patches<'life0, 'async_trait>(
&'life0 mut self,
patches: HashMap<VaultId, FolderPatch>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn import_folder_patches<'life0, 'async_trait>(
&'life0 mut self,
patches: HashMap<VaultId, FolderPatch>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Create folders from a collection of folder patches.
If the folders already exist they will be overwritten.
Sourcefn compact_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
key: &'life2 AccessKey,
) -> Pin<Box<dyn Future<Output = Result<AccountEvent, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn compact_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
key: &'life2 AccessKey,
) -> Pin<Box<dyn Future<Output = Result<AccountEvent, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compact an event log file.
Sourcefn rename_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
name: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rename_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
name: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set the name of a folder.
Sourcefn update_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update the flags for a folder.
Sourcefn description<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn description<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the description for a folder.
Sourcefn set_description<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
description: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<WriteEvent, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_description<'life0, 'life1, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
description: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<WriteEvent, Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set the description of the currently open folder.
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.