pub struct Settings {
pub default_environment: String,
pub vault_dir: String,
pub argon2_memory_kib: u32,
pub argon2_iterations: u32,
pub argon2_parallelism: u32,
}Expand description
Project-level configuration, loaded from .envvault.toml.
Every field has a sensible default so EnvVault works out-of-the-box without any config file at all.
Fields§
§default_environment: StringWhich environment to use when none is specified (e.g. “dev”).
vault_dir: StringDirectory (relative to project root) where vault files are stored.
argon2_memory_kib: u32Argon2 memory cost in KiB (default: 64 MB).
argon2_iterations: u32Argon2 iteration count (default: 3).
argon2_parallelism: u32Argon2 parallelism degree (default: 4).
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load(project_dir: &Path) -> Result<Self>
pub fn load(project_dir: &Path) -> Result<Self>
Load settings from <project_dir>/.envvault.toml.
If the file does not exist, sensible defaults are returned. If the file exists but cannot be parsed, an error is returned.
Sourcepub fn vault_path(&self, project_dir: &Path, env_name: &str) -> PathBuf
pub fn vault_path(&self, project_dir: &Path, env_name: &str) -> PathBuf
Build the full path to a vault file for a given environment.
Example: project_dir/.envvault/dev.vault
Sourcepub fn argon2_params(&self) -> Argon2Params
pub fn argon2_params(&self) -> Argon2Params
Convert the Argon2 settings into crypto-layer params.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
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