pub struct Config {
pub store_id: String,
pub device_id: String,
pub store_dir: StoreDir,
pub store_name: String,
pub encryption_key_stored: bool,
pub encryption_key_fingerprint: Option<String>,
pub cloud_home: CloudHomeConfig,
}Expand description
Sync + storage configuration for one store.
Fields§
§store_id: String§device_id: StringUnique device identifier for sync changeset namespacing.
store_dir: StoreDir§store_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 with_defaults(
store_id: String,
device_id: String,
store_dir: StoreDir,
store_name: String,
) -> Config
pub fn with_defaults( store_id: String, device_id: String, store_dir: StoreDir, store_name: String, ) -> Config
Construct a config with defaults for a new or joined store.
Sourcepub fn save_to_config_yaml(&self) -> Result<(), ConfigError>
pub fn save_to_config_yaml(&self) -> Result<(), ConfigError>
Persist the sync config to store_dir/config.yaml.
Sourcepub fn load_from_config_yaml(store_dir: StoreDir) -> Result<Config, ConfigError>
pub fn load_from_config_yaml(store_dir: StoreDir) -> Result<Config, ConfigError>
Read store_dir/config.yaml back into a runtime Config; store_dir
is supplied by the caller, since it is not itself persisted (see the
module doc). A missing or unparseable file is a loud ConfigError
naming the path.
Trait Implementations§
Source§impl From<Config> for CovenConfig
impl From<Config> for CovenConfig
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin 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.