pub trait ServerAccountStorage {
Show 18 methods
// Required methods
fn account_id(&self) -> &AccountId;
fn list_device_keys(&self) -> HashSet<&DevicePublicKey>;
fn paths(&self) -> Arc<Paths>;
fn folders(&self) -> &HashMap<VaultId, Arc<RwLock<FolderEventLog>>>;
fn folders_mut(
&mut self,
) -> &mut HashMap<VaultId, Arc<RwLock<FolderEventLog>>>;
fn set_devices(&mut self, devices: IndexSet<TrustedDevice>);
fn rename_account<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_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 write_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_login_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn replace_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
diff: &'life2 FolderDiff,
) -> Pin<Box<dyn Future<Output = Result<(FolderEventLog, Vault), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn import_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
account_data: &'life1 CreateSet,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Summary>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn import_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
buffer: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn rename_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_folder<'life0, 'life1, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_account<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for server storage implementations.
Required Methods§
Sourcefn account_id(&self) -> &AccountId
fn account_id(&self) -> &AccountId
Account identifier.
Sourcefn list_device_keys(&self) -> HashSet<&DevicePublicKey>
fn list_device_keys(&self) -> HashSet<&DevicePublicKey>
List the public keys of trusted devices.
Sourcefn folders_mut(&mut self) -> &mut HashMap<VaultId, Arc<RwLock<FolderEventLog>>>
fn folders_mut(&mut self) -> &mut HashMap<VaultId, Arc<RwLock<FolderEventLog>>>
Mutable folder event logs.
Sourcefn set_devices(&mut self, devices: IndexSet<TrustedDevice>)
fn set_devices(&mut self, devices: IndexSet<TrustedDevice>)
Set the collection of trusted devices.
Sourcefn rename_account<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn rename_account<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Rename the account.
Sourcefn read_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_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,
folder_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 storage.
Sourcefn write_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a vault to storage.
Sourcefn write_login_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_login_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
vault: &'life1 Vault,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a login vault to storage.
Sourcefn replace_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
diff: &'life2 FolderDiff,
) -> Pin<Box<dyn Future<Output = Result<(FolderEventLog, Vault), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn replace_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
diff: &'life2 FolderDiff,
) -> Pin<Box<dyn Future<Output = Result<(FolderEventLog, Vault), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Replace all the events for a folder.
Sourcefn set_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_folder_flags<'life0, 'life1, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
flags: VaultFlags,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update folder flags.
Sourcefn import_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
account_data: &'life1 CreateSet,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn import_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
account_data: &'life1 CreateSet,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Import an account from a change set of event logs.
Does not prepare the identity vault event log
which should be done by calling initialize_account()
before creating new storage.
Intended to be used on a server to create a new account from a collection of patches.
Sourcefn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Summary>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_folders<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Summary>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load folders from the local disc.
Creates the in-memory event logs for each folder on disc.
Sourcefn import_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
buffer: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn import_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
buffer: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Import a folder into an existing account.
If a folder with the same identifier already exists it is overwritten.
Buffer is the encoded representation of the vault.
Sourcefn rename_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
id: &'life1 VaultId,
name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Set the name of a folder.