ServerStorage

Enum ServerStorage 

Source
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

Source

pub async fn new( target: BackendTarget, account_id: &AccountId, ) -> Result<Self, Error>

Create new server storage.

Source

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

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,

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,

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,

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,

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,

Force merge from a set of updates. Read more
Source§

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

Merge a diff into this storage.
Source§

impl ServerAccountStorage for ServerStorage

Source§

fn account_id(&self) -> &AccountId

Account identifier.
Source§

fn list_device_keys(&self) -> HashSet<&DevicePublicKey>

List the public keys of trusted devices.
Source§

fn paths(&self) -> Arc<Paths>

Computed storage directories for the provider.
Source§

fn folders(&self) -> &HashMap<VaultId, Arc<RwLock<FolderEventLog>>>

Folder event logs.
Source§

fn folders_mut(&mut self) -> &mut HashMap<VaultId, Arc<RwLock<FolderEventLog>>>

Mutable folder event logs.
Source§

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

Set the name of a folder.
Source§

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,

Delete a folder.
Source§

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,

Delete this account.
Source§

impl StorageEventLogs for ServerStorage

Source§

type Error = Error

Error type for storage event logs.
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,

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,

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,

Clone of the device log.
Source§

fn folder_details<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<IndexSet<Summary>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Folders managed by this storage. Read more
Source§

fn folder_log<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 VaultId, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<FolderEventLog>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Folder event log.
Source§

impl SyncStorage for ServerStorage

Source§

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,

Sync status for the storage.
Source§

fn create_set<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CreateSet, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Set of all event logs. Read more
Source§

fn debug_account_tree<'life0, 'async_trait>( &'life0 self, account_id: AccountId, ) -> Pin<Box<dyn Future<Output = Result<DebugTree, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Create a debug tree of this account.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,