pub enum BackendTarget {
FileSystem(Arc<Paths>),
Database(Arc<Paths>, Client),
}Expand description
Target backend.
Variants§
Implementations§
Source§impl BackendTarget
impl BackendTarget
Sourcepub async fn infer<T: AsRef<Paths>>(
paths: T,
options: InferOptions,
) -> Result<Self, Error>
pub async fn infer<T: AsRef<Paths>>( paths: T, options: InferOptions, ) -> Result<Self, Error>
Infer and initialize a new backend target.
A database backend will be used if a database file already exists or if there are no accounts. If a database backend is selected migrations are run otherwise paths are scaffolded for the file system backend.
If the audit feature is enabled the corresponding audit
provider for the backend is initialized.
Sourcepub async fn dump_info(&self) -> Result<(), Error>
pub async fn dump_info(&self) -> Result<(), Error>
Trace information about the backend.
Typically used when an application starts.
Sourcepub async fn from_paths<T: AsRef<Paths>>(
paths: T,
) -> Result<BackendTarget, Error>
pub async fn from_paths<T: AsRef<Paths>>( paths: T, ) -> Result<BackendTarget, Error>
Create a backend target from paths.
Sourcepub async fn read_device_vault(
&self,
account_id: &AccountId,
) -> Result<Option<Vault>, Error>
pub async fn read_device_vault( &self, account_id: &AccountId, ) -> Result<Option<Vault>, Error>
Read the device vault.
Sourcepub fn with_account_id(self, account_id: &AccountId) -> Self
pub fn with_account_id(self, account_id: &AccountId) -> Self
Set paths to be for an account identifier.
Sourcepub async fn list_accounts(&self) -> Result<Vec<PublicIdentity>, Error>
pub async fn list_accounts(&self) -> Result<Vec<PublicIdentity>, Error>
List accounts.
Sourcepub async fn list_folders(
&self,
account_id: &AccountId,
) -> Result<Vec<Summary>, Error>
pub async fn list_folders( &self, account_id: &AccountId, ) -> Result<Vec<Summary>, Error>
List user folders for an account.
Sourcepub async fn list_files(&self) -> Result<IndexSet<ExternalFile>, Error>
Available on crate feature files only.
pub async fn list_files(&self) -> Result<IndexSet<ExternalFile>, Error>
files only.List external files for this backend target.
Trait Implementations§
Source§impl Clone for BackendTarget
impl Clone for BackendTarget
Source§fn clone(&self) -> BackendTarget
fn clone(&self) -> BackendTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackendTarget
impl Debug for BackendTarget
Auto Trait Implementations§
impl Freeze for BackendTarget
impl RefUnwindSafe for BackendTarget
impl Send for BackendTarget
impl Sync for BackendTarget
impl Unpin for BackendTarget
impl UnwindSafe for BackendTarget
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