Trait ClientFolderStorage

Source
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§

Source

fn folders(&self) -> &HashMap<VaultId, Folder>

In-memory folders.

Source

fn folders_mut(&mut self) -> &mut HashMap<VaultId, Folder>

Mutable in-memory folders.

Source

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.

Source

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.

Source

fn current_folder(&self) -> Option<Summary>

Currently open folder.

Source

fn open_folder(&self, folder_id: &VaultId) -> Result<ReadEvent, Error>

Mark a folder as the currently open folder.

Source

fn close_folder(&self)

Close the current open folder.

Provided Methods§

Source

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.

Source

fn list_folders(&self) -> &[Summary]

List the in-memory folders.

Source

fn find_folder(&self, vault: &FolderRef) -> Option<&Summary>

Find a folder in this storage by reference.

Source

fn find<F>(&self, predicate: F) -> Option<&Summary>
where F: FnMut(&&Summary) -> bool,

Find a folder in this storage using a predicate.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Implementors§