pub enum ServerStorage {
FileSystem(SyncImpl<ServerFileStorage>),
Database(SyncImpl<ServerDatabaseStorage>),
}Expand description
Server storage backed by filesystem or database.
Variants§
FileSystem(SyncImpl<ServerFileStorage>)
Filesystem storage.
Database(SyncImpl<ServerDatabaseStorage>)
Database storage.
Implementations§
Source§impl ServerStorage
impl ServerStorage
Sourcepub async fn new(
target: BackendTarget,
account_id: &AccountId,
) -> Result<Self, Error>
pub async fn new( target: BackendTarget, account_id: &AccountId, ) -> Result<Self, Error>
Create new server storage.
Sourcepub async fn create_account(
target: BackendTarget,
account_id: &AccountId,
account_data: &CreateSet,
) -> Result<Self, Error>
pub async fn create_account( target: BackendTarget, account_id: &AccountId, account_data: &CreateSet, ) -> Result<Self, Error>
Create an account in server storage.
Trait Implementations§
Source§impl ForceMerge for ServerStorage
impl ForceMerge for ServerStorage
Source§fn force_merge_identity<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: FolderDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn force_merge_identity<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: FolderDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Force merge changes to the identity folder.
Source§fn force_merge_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: AccountDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn force_merge_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: AccountDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Force merge changes to the account event log.
Source§fn force_merge_device<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: DeviceDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn force_merge_device<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: DeviceDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Force merge changes to the devices event log.
Source§fn force_merge_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
diff: FolderDiff,
outcome: &'life2 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn force_merge_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
diff: FolderDiff,
outcome: &'life2 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Force merge changes to a folder.
Source§fn force_merge_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
update_set: UpdateSet,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
fn force_merge_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
update_set: UpdateSet,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Force merge from a set of updates. Read more
Source§impl Merge for ServerStorage
impl Merge for ServerStorage
Source§fn merge_identity<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: FolderDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<CheckedPatch, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge_identity<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: FolderDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<CheckedPatch, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Merge changes to the identity folder.
Source§fn compare_identity<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compare_identity<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compare the identity folder.
Source§fn merge_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: AccountDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(CheckedPatch, HashSet<VaultId>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge_account<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: AccountDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(CheckedPatch, HashSet<VaultId>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Merge changes to the account event log.
Source§fn compare_account<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compare_account<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compare the account events.
Source§fn merge_device<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: DeviceDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<CheckedPatch, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge_device<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: DeviceDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<CheckedPatch, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Merge changes to the devices event log.
Source§fn compare_device<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compare_device<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compare the device events.
Source§fn merge_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
diff: FolderDiff,
outcome: &'life2 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(CheckedPatch, Vec<WriteEvent>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn merge_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
folder_id: &'life1 VaultId,
diff: FolderDiff,
outcome: &'life2 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<(CheckedPatch, Vec<WriteEvent>), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Merge changes to a folder.
Source§fn compare_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
state: &'life2 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn compare_folder<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder_id: &'life1 VaultId,
state: &'life2 CommitState,
) -> Pin<Box<dyn Future<Output = Result<Comparison, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compare folder events.
Source§fn compare<'life0, 'life1, 'async_trait>(
&'life0 mut self,
remote_status: &'life1 SyncStatus,
) -> Pin<Box<dyn Future<Output = Result<SyncCompare, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
fn compare<'life0, 'life1, 'async_trait>(
&'life0 mut self,
remote_status: &'life1 SyncStatus,
) -> Pin<Box<dyn Future<Output = Result<SyncCompare, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Compare the local state to a remote status.
Source§fn merge<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: SyncDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<SyncCompare, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
fn merge<'life0, 'life1, 'async_trait>(
&'life0 mut self,
diff: SyncDiff,
outcome: &'life1 mut MergeOutcome,
) -> Pin<Box<dyn Future<Output = Result<SyncCompare, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Merge a diff into this storage.
Source§impl ServerAccountStorage for ServerStorage
impl ServerAccountStorage for ServerStorage
Source§fn account_id(&self) -> &AccountId
fn account_id(&self) -> &AccountId
Account identifier.
Source§fn list_device_keys(&self) -> HashSet<&DevicePublicKey>
fn list_device_keys(&self) -> HashSet<&DevicePublicKey>
List the public keys of trusted devices.
Source§fn 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.
Source§fn set_devices(&mut self, devices: IndexSet<TrustedDevice>)
fn set_devices(&mut self, devices: IndexSet<TrustedDevice>)
Set the collection of trusted devices.
Source§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 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.
Source§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 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.
Source§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_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.
Source§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 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.
Source§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 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.
Source§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 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.
Source§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 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. Read more
Source§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 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. Read more
Source§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 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. Read more
Source§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 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.
Source§impl StorageEventLogs for ServerStorage
impl StorageEventLogs for ServerStorage
Source§fn identity_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<FolderEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn identity_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<FolderEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clone of the identity log.
Source§fn account_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<AccountEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn account_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<AccountEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clone of the account log.
Source§fn device_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<DeviceEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn device_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<DeviceEventLog>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clone of the device log.
Source§impl SyncStorage for ServerStorage
impl SyncStorage for ServerStorage
Source§fn is_client_storage(&self) -> bool
fn is_client_storage(&self) -> bool
Determine if this is client-side storage.
Source§fn sync_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatus, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatus, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sync status for the storage.
Auto Trait Implementations§
impl Freeze for ServerStorage
impl !RefUnwindSafe for ServerStorage
impl Send for ServerStorage
impl Sync for ServerStorage
impl Unpin for ServerStorage
impl !UnwindSafe for ServerStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more