Trait encrypt_config::source::SecretSource

source ·
pub trait SecretSource: Serialize + for<'de> Deserialize<'de> + Default {
    const PATH: &'static str;
    const KEYRING_ENTRY: &'static str;

    // Provided methods
    fn path() -> PathBuf { ... }
    fn load() -> Result<Self, ConfigError> { ... }
    fn save(&self) -> Result<(), ConfigError> { ... }
}
Available on crate features secret and persist only.
Expand description

A trait for persisted but not encrypted config source.

Required Associated Constants§

source

const PATH: &'static str

Available on non-crate feature default_config_dir only.

The path to persist the config file.

source

const KEYRING_ENTRY: &'static str

The keyring entry name.

Provided Methods§

source

fn path() -> PathBuf

Return the path to the config file.

source

fn load() -> Result<Self, ConfigError>

Load the config from the file.

source

fn save(&self) -> Result<(), ConfigError>

Save and encrypt the config to the file.

Object Safety§

This trait is not object safe.

Implementors§