sos_net

Struct NetworkAccount

Source
pub struct NetworkAccount { /* private fields */ }
Expand description

Account with networking capability.

Implementations§

Source§

impl NetworkAccount

Source

pub async fn stop_listening(&self, origin: &Origin)

Available on crate feature listen only.

Stop listening to a server websocket.

Source

pub async fn listen( &self, origin: &Origin, options: ListenOptions, listener: Option<Sender<(ChangeNotification, RemoteResult)>>, ) -> Result<()>

Available on crate feature listen only.

Listen for changes on a server websocket.

Source§

impl NetworkAccount

Source

pub async fn deactivate(&mut self)

Deactive this account by closing down long-running tasks.

Does not sign out of the account so is similar to moving this account to the background so the data is still accessible.

This can be used when implementing quick account switching to shutdown the websocket and file transfers.

Server remotes are left intact so that making changes will still sync with server(s).

Source

pub async fn activate(&mut self) -> Result<()>

Activate this account by resuming websocket connections and file transfers.

Source

pub async fn revoke_device( &mut self, device_key: &DevicePublicKey, ) -> Result<()>

Revoke a device.

Source

pub fn set_connection_id(&mut self, value: Option<String>)

Set the connection identifier.

Source

pub fn connection_id(&self) -> Option<&str>

Connection identifier.

Source

pub async fn add_server(&mut self, origin: Origin) -> Result<Option<Error>>

Add a server.

An initial sync is performed with the server and the result includes a possible error encountered during the initial sync.

If a server with the given origin already exists it is overwritten.

Source

pub async fn update_server(&mut self, origin: Origin) -> Result<bool>

Update server origin information.

Source

pub async fn remove_server( &mut self, origin: &Origin, ) -> Result<Option<RemoteBridge>>

Remove a server.

Source

pub async fn servers(&self) -> HashSet<Origin>

List the origin servers.

Derived from the currently configuted in-memory remotes.

Source

pub async fn recover_remote_folder( &mut self, origin: &Origin, folder_id: &VaultId, ) -> Result<Summary>

Try to recover a folder from a remote origin; it is an error if the folder exists in memory or on disc.

Source§

impl NetworkAccount

Source

pub async fn new_unauthenticated( address: Address, data_dir: Option<PathBuf>, options: NetworkAccountOptions, ) -> Result<Self>

Prepare an account for sign in.

After preparing an account call sign_in to authenticate a user.

Source

pub async fn new_account( account_name: String, passphrase: SecretString, data_dir: Option<PathBuf>, options: NetworkAccountOptions, ) -> Result<Self>

Create a new account with the given name, passphrase and provider.

Uses standard flags for the account builder for more control of the created account use new_account_with_builder().

Source

pub async fn new_account_with_builder( account_name: String, passphrase: SecretString, data_dir: Option<PathBuf>, options: NetworkAccountOptions, builder: impl Fn(AccountBuilder) -> AccountBuilder + Send, ) -> Result<Self>

Create a new account with the given name, passphrase and provider and modify the account builder.

Source

pub fn inflight_transfers(&self) -> Result<Arc<InflightTransfers>>

Available on crate feature files only.

Inflight file transfers.

Source§

impl NetworkAccount

Source

pub async fn server_status( &self, options: &SyncOptions, ) -> HashMap<Origin, Result<SyncStatus>>

Sync status for remote servers.

Source

pub async fn transfer_status( &self, options: &SyncOptions, ) -> Result<HashMap<Origin, Result<FileTransfersSet>>>

Available on crate feature files only.

Transfer status for remote servers.

Trait Implementations§

Source§

impl Account for NetworkAccount

Source§

type Error = Error

Errors for this account.
Source§

type NetworkResult = SyncResult

Result type for network-aware implementations.
Source§

fn address(&self) -> &Address

Account address.
Source§

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

User storage paths.
Source§

fn is_authenticated<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Determine if the account is authenticated.
Source§

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

Signing key for the account.
Source§

fn new_device_vault<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(DeviceSigner, DeviceManager)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new in-memory device vault. Read more
Source§

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

Signing key for the device.
Source§

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

Public key for the device signing key.
Source§

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

Current device information.
Source§

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

Collection of trusted devices.
Source§

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

Public identity information.
Source§

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

Label of this account.
Source§

fn folder_description<'life0, 'life1, 'async_trait>( &'life0 mut self, folder: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the description of a folder. Read more
Source§

fn set_folder_description<'life0, 'life1, 'async_trait>( &'life0 mut self, folder: &'life1 Summary, description: impl 'async_trait + AsRef<str> + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<FolderChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set the description of a folder. Read more
Source§

fn find_folder_password<'life0, 'life1, 'async_trait>( &'life0 self, folder_id: &'life1 VaultId, ) -> Pin<Box<dyn Future<Output = Result<Option<AccessKey>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find the password for a folder.
Source§

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

Generate the password for a folder.
Source§

fn identity_vault_buffer<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load the buffer of the encrypted vault for this account. Read more
Source§

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

Summary of the identity folder for the account.
Source§

fn change_cipher<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, account_key: &'life1 AccessKey, cipher: &'life2 Cipher, kdf: Option<KeyDerivation>, ) -> Pin<Box<dyn Future<Output = Result<CipherComparison>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Change the cipher for an account.
Source§

fn change_account_password<'life0, 'async_trait>( &'life0 mut self, password: SecretString, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Change the password for an account.
Source§

fn sign_in<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 AccessKey, ) -> Pin<Box<dyn Future<Output = Result<Vec<Summary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Access an account by signing in. Read more
Source§

fn sign_in_with_options<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 AccessKey, options: SigninOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<Summary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Access an account by signing in with the given options. Read more
Source§

fn verify<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 AccessKey, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Verify an access key for this account. Read more
Source§

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

Open a folder.
Source§

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

Current open folder.
Source§

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

Sign out of the account.
Source§

fn rename_account<'life0, 'async_trait>( &'life0 mut self, account_name: String, ) -> Pin<Box<dyn Future<Output = Result<AccountChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rename this account.
Source§

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

Delete the account for this user and sign out.
Source§

fn find<'life0, 'async_trait, P>( &'life0 self, predicate: P, ) -> Pin<Box<dyn Future<Output = Option<Summary>> + Send + 'async_trait>>
where P: FnMut(&&Summary) -> bool + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Try to find a folder using a predicate.
Source§

fn storage<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<ClientStorage>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Storage provider.
Source§

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

Load folders into memory. Read more
Source§

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

List in-memory folders managed by this account.
Source§

fn secret_ids<'life0, 'life1, 'async_trait>( &'life0 self, summary: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<Vec<SecretId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read the secret identifiers in a vault.
Source§

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

Account data.
Source§

fn root_commit<'life0, 'life1, 'async_trait>( &'life0 self, summary: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<CommitHash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Root commit hash for a folder.
Source§

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

Commit state of the identity vault. Read more
Source§

fn commit_state<'life0, 'life1, 'async_trait>( &'life0 self, summary: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<CommitState>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the commit state for a folder. Read more
Source§

fn compact_account<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<Summary, (AccountEvent, u64, u64)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Compact the identity folder and all user folders.
Source§

fn compact_folder<'life0, 'life1, 'async_trait>( &'life0 mut self, folder: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<(AccountEvent, u64, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Compact the event log file for a folder.
Source§

fn restore_folder<'life0, 'life1, 'async_trait>( &'life0 mut self, folder_id: &'life1 VaultId, records: Vec<EventRecord>, ) -> Pin<Box<dyn Future<Output = Result<Summary>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Restore a folder from an event log.
Source§

fn change_folder_password<'life0, 'life1, 'async_trait>( &'life0 mut self, folder: &'life1 Summary, new_key: AccessKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Change the password for a folder. Read more
Source§

fn detached_view<'life0, 'life1, 'async_trait>( &'life0 self, summary: &'life1 Summary, commit: CommitHash, ) -> Pin<Box<dyn Future<Output = Result<DetachedView>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature search only.
Create a detached view of an event log until a particular commit. Read more
Source§

fn initialize_search_index<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(DocumentCount, Vec<Summary>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature search only.
Initialize the search index. Read more
Source§

fn statistics<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AccountStatistics> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature search only.
Compute the account statistics. Read more
Source§

fn index<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<SearchIndex>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature search only.
Search index for the account.
Source§

fn query_view<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, views: &'life1 [DocumentView], archive: Option<&'life2 ArchiveFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Available on crate feature search only.
Query with document views.
Source§

fn query_map<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, filter: QueryFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Document>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature search only.
Query the search index.
Source§

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

Available on crate feature search only.
Get the search index document count statistics.
Source§

fn document_exists<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, label: &'life2 str, id: Option<&'life3 SecretId>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature search only.
Determine if a document exists in a folder.
Source§

fn download_file<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, vault_id: &'life1 VaultId, secret_id: &'life2 SecretId, file_name: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Available on crate feature files only.
Decrypt a file and return the buffer.
Source§

fn create_secret<'life0, 'async_trait>( &'life0 mut self, meta: SecretMeta, secret: Secret, options: AccessOptions, ) -> Pin<Box<dyn Future<Output = Result<SecretChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a secret in the current open folder or a specific folder.
Source§

fn insert_secrets<'life0, 'async_trait>( &'life0 mut self, secrets: Vec<(SecretMeta, Secret)>, ) -> Pin<Box<dyn Future<Output = Result<SecretInsert<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Bulk insert secrets into the currently open folder.
Source§

fn update_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, secret_id: &'life1 SecretId, meta: SecretMeta, secret: Option<Secret>, options: AccessOptions, destination: Option<&'life2 Summary>, ) -> Pin<Box<dyn Future<Output = Result<SecretChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Update a secret in the current open folder or a specific folder. Read more
Source§

fn move_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, secret_id: &'life1 SecretId, from: &'life2 Summary, to: &'life3 Summary, options: AccessOptions, ) -> Pin<Box<dyn Future<Output = Result<SecretMove<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Move a secret between folders.
Source§

fn read_secret<'life0, 'life1, 'async_trait>( &'life0 self, secret_id: &'life1 SecretId, folder: Option<Summary>, ) -> Pin<Box<dyn Future<Output = Result<(SecretRow, ReadEvent)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read a secret in the current open folder.
Source§

fn delete_secret<'life0, 'life1, 'async_trait>( &'life0 mut self, secret_id: &'life1 SecretId, options: AccessOptions, ) -> Pin<Box<dyn Future<Output = Result<SecretDelete<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a secret and remove any external files.
Source§

fn archive<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, from: &'life1 Summary, secret_id: &'life2 SecretId, options: AccessOptions, ) -> Pin<Box<dyn Future<Output = Result<SecretMove<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Move a secret to the archive. Read more
Source§

fn unarchive<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, secret_id: &'life1 SecretId, secret_meta: &'life2 SecretMeta, options: AccessOptions, ) -> Pin<Box<dyn Future<Output = Result<(SecretMove<Self::NetworkResult>, Summary)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Move a secret out of the archive. Read more
Source§

fn update_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, secret_id: &'life1 SecretId, meta: SecretMeta, path: impl 'async_trait + AsRef<Path> + Send + Sync, options: AccessOptions, destination: Option<&'life2 Summary>, ) -> Pin<Box<dyn Future<Output = Result<SecretChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Available on crate feature files only.
Update a file secret. Read more
Source§

fn create_folder<'life0, 'async_trait>( &'life0 mut self, name: String, options: NewFolderOptions, ) -> Pin<Box<dyn Future<Output = Result<FolderCreate<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a folder.
Source§

fn rename_folder<'life0, 'life1, 'async_trait>( &'life0 mut self, summary: &'life1 Summary, name: String, ) -> Pin<Box<dyn Future<Output = Result<FolderChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Rename a folder.
Source§

fn update_folder_flags<'life0, 'life1, 'async_trait>( &'life0 mut self, summary: &'life1 Summary, flags: VaultFlags, ) -> Pin<Box<dyn Future<Output = Result<FolderChange<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update folder flags.
Source§

fn import_folder<'life0, 'async_trait>( &'life0 mut self, path: impl 'async_trait + AsRef<Path> + Send + Sync, key: AccessKey, overwrite: bool, ) -> Pin<Box<dyn Future<Output = Result<FolderCreate<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a folder from a vault file.
Source§

fn import_identity_folder<'life0, 'async_trait>( &'life0 mut self, vault: Vault, ) -> Pin<Box<dyn Future<Output = Result<AccountEvent>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import and overwrite the identity folder from a vault. Read more
Source§

fn import_folder_buffer<'life0, 'async_trait>( &'life0 mut self, buffer: impl 'async_trait + AsRef<[u8]> + Send + Sync, key: AccessKey, overwrite: bool, ) -> Pin<Box<dyn Future<Output = Result<FolderCreate<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a folder from a vault buffer.
Source§

fn export_folder<'life0, 'life1, 'async_trait>( &'life0 mut self, path: impl 'async_trait + AsRef<Path> + Send + Sync, summary: &'life1 Summary, new_key: AccessKey, save_key: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Export a folder as a vault file.
Source§

fn export_folder_buffer<'life0, 'life1, 'async_trait>( &'life0 mut self, summary: &'life1 Summary, new_key: AccessKey, save_key: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Export a folder to a buffer.
Source§

fn delete_folder<'life0, 'life1, 'async_trait>( &'life0 mut self, summary: &'life1 Summary, ) -> Pin<Box<dyn Future<Output = Result<FolderDelete<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a folder.
Source§

fn load_avatar<'life0, 'life1, 'async_trait>( &'life0 self, secret_id: &'life1 SecretId, folder: Option<Summary>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature contacts only.
Try to load an avatar JPEG image for a contact. Read more
Source§

fn export_contact<'life0, 'life1, 'async_trait>( &'life0 self, path: impl 'async_trait + AsRef<Path> + Send + Sync, secret_id: &'life1 SecretId, folder: Option<Summary>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature contacts only.
Export a contact secret to a vCard file.
Source§

fn export_all_contacts<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + AsRef<Path> + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature contacts only.
Export all contacts to a single vCard.
Source§

fn import_contacts<'life0, 'life1, 'async_trait>( &'life0 mut self, content: &'life1 str, progress: impl 'async_trait + Fn(ContactImportProgress) + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<Vec<SecretId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature contacts only.
Import contacts from a vCard string buffer. Read more
Source§

fn export_unsafe_archive<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + AsRef<Path> + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature migrate only.
Write a zip archive containing all the secrets for the account unencrypted. Read more
Source§

fn import_file<'life0, 'async_trait>( &'life0 mut self, target: ImportTarget, ) -> Pin<Box<dyn Future<Output = Result<FolderCreate<Self::NetworkResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature migrate only.
Import secrets from another app.
Source§

fn export_backup_archive<'life0, 'async_trait>( &'life0 self, path: impl 'async_trait + AsRef<Path> + Send + Sync, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature archive only.
Create a backup archive containing the encrypted data for the account.
Source§

fn restore_archive_inventory<'async_trait, R>( buffer: R, ) -> Pin<Box<dyn Future<Output = Result<Inventory>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + AsyncSeek + Unpin + Send + Sync,

Available on crate feature archive only.
Read the inventory from an archive.
Source§

fn import_backup_archive<'async_trait>( path: impl 'async_trait + AsRef<Path> + Send + Sync, options: RestoreOptions, data_dir: Option<PathBuf>, ) -> Pin<Box<dyn Future<Output = Result<PublicIdentity>> + Send + 'async_trait>>

Available on crate feature archive only.
Restore from a backup archive file.
Source§

fn restore_backup_archive<'life0, 'async_trait>( &'life0 mut self, path: impl 'async_trait + AsRef<Path> + Send + Sync, password: SecretString, options: RestoreOptions, data_dir: Option<PathBuf>, ) -> Pin<Box<dyn Future<Output = Result<PublicIdentity>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature archive only.
Restore from a backup archive file.
Source§

fn default_folder<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Summary>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Find the default folder.
Source§

fn authenticator_folder<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Summary>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Find the authenticator folder.
Source§

fn contacts_folder<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Summary>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Find the contacts folder.
Source§

fn archive_folder<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Summary>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Find the archive folder.
Source§

impl AccountSync for NetworkAccount

Source§

fn sync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SyncResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform a full sync of the account using the default options. Read more
Source§

fn sync_with_options<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 SyncOptions, ) -> Pin<Box<dyn Future<Output = SyncResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform a full sync of the account using the given options. Read more
Source§

fn sync_file_transfers<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 SyncOptions, ) -> Pin<Box<dyn Future<Output = SyncResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature files only.
Sync file transfers. Read more
Source§

fn force_update<'life0, 'life1, 'async_trait>( &'life0 self, account_data: UpdateSet, options: &'life1 SyncOptions, ) -> Pin<Box<dyn Future<Output = SyncResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Force update an account on remote servers. Read more
Source§

impl From<&NetworkAccount> for AccountRef

Source§

fn from(value: &NetworkAccount) -> Self

Converts to this type from the input type.
Source§

impl StorageEventLogs for NetworkAccount

Source§

fn identity_log<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<FolderEventLog>>>> + 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>>>> + 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>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clone of the device log.
Source§

fn file_log<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<FileEventLog>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature files only.
Clone of the file log.
Source§

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

Folder identifiers managed by this storage.
Source§

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

Folder information managed by this storage.
Source§

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

Folder event log.
Source§

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

Available on crate feature files only.
Canonical collection of files reduced from the file event log.
Source§

impl SyncStorage for NetworkAccount

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>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the sync status.
Source§

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

Change set of all event logs. Read more

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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,

Source§

impl<T> MaybeSendSync for T