pub struct Config {
pub library_id: String,
pub device_id: String,
pub library_dir: LibraryDir,
pub library_name: String,
pub encryption_key_stored: bool,
pub encryption_key_fingerprint: Option<String>,
pub cloud_home: CloudHomeConfig,
}Expand description
Sync + storage configuration for one library.
Fields§
§library_id: String§device_id: StringUnique device identifier for sync changeset namespacing.
library_dir: LibraryDir§library_name: String§encryption_key_stored: boolWhether an encryption key is stored in the keyring (hint flag).
encryption_key_fingerprint: Option<String>SHA-256 fingerprint of the encryption key (detects wrong key without decryption).
cloud_home: CloudHomeConfigCloud home provider + its settings.
Implementations§
Source§impl Config
impl Config
Sourcepub fn sync_enabled(&self, key_service: &KeyService) -> bool
pub fn sync_enabled(&self, key_service: &KeyService) -> bool
Whether sync is configured: a provider is selected and the matching settings + credentials are present.
Sourcepub fn is_dev_mode() -> bool
pub fn is_dev_mode() -> bool
Whether the app is running in dev mode (loads secrets from env / .env
instead of the OS keyring). Set COVEN_DEV_MODE or place a .env file.
Sourcepub fn with_defaults(
library_id: String,
device_id: String,
library_dir: LibraryDir,
library_name: String,
) -> Self
pub fn with_defaults( library_id: String, device_id: String, library_dir: LibraryDir, library_name: String, ) -> Self
Construct a config with defaults for a new or joined library.
Sourcepub fn save(&self) -> Result<(), ConfigError>
pub fn save(&self) -> Result<(), ConfigError>
Persist the sync config to library_dir/config.yaml.
Sourcepub fn save_to_config_yaml(&self) -> Result<(), ConfigError>
pub fn save_to_config_yaml(&self) -> Result<(), ConfigError>
Persist the sync config to library_dir/config.yaml.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.