pub trait AppConfigSecurityExt: Sized {
Show 15 methods
// Required methods
fn load() -> Self;
fn load_async() -> impl Future<Output = Self> + Send;
fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>;
fn save(&self) -> Result<()>;
fn save_async(&self) -> impl Future<Output = Result<()>> + Send;
fn save_to_path_async(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<()>> + Send;
fn load_with_env() -> Self;
fn load_with_env_async() -> impl Future<Output = Self> + Send;
fn sanitize_secrets(&mut self);
fn api_key_keychain_status() -> Vec<(&'static str, bool)>;
fn has_plaintext_secrets(&self) -> bool;
fn hydrate_secrets_sync(&mut self) -> Result<()>;
fn hydrate_secrets(&mut self) -> impl Future<Output = Result<()>> + Send;
fn migrate_secrets_sync(&self) -> Result<bool>;
fn migrate_secrets(&self) -> impl Future<Output = Result<bool>> + Send;
}Expand description
Required Methods§
Sourcefn load_async() -> impl Future<Output = Self> + Send
fn load_async() -> impl Future<Output = Self> + Send
Load configuration from disk asynchronously.
Sourcefn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>
fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>
Save configuration to disk at an explicit path.
Sourcefn save_async(&self) -> impl Future<Output = Result<()>> + Send
fn save_async(&self) -> impl Future<Output = Result<()>> + Send
Save configuration to disk asynchronously.
Sourcefn save_to_path_async(
&self,
path: impl AsRef<Path> + Send,
) -> impl Future<Output = Result<()>> + Send
fn save_to_path_async( &self, path: impl AsRef<Path> + Send, ) -> impl Future<Output = Result<()>> + Send
Save configuration to disk at an explicit path (async).
Sourcefn load_with_env() -> Self
fn load_with_env() -> Self
Load configuration with environment variable overrides applied.
Sourcefn load_with_env_async() -> impl Future<Output = Self> + Send
fn load_with_env_async() -> impl Future<Output = Self> + Send
Load configuration asynchronously with environment variable overrides.
Sourcefn sanitize_secrets(&mut self)
fn sanitize_secrets(&mut self)
Clear secrets from the struct (used before saving to disk).
Sourcefn api_key_keychain_status() -> Vec<(&'static str, bool)>
fn api_key_keychain_status() -> Vec<(&'static str, bool)>
Check which API key providers have secrets stored in the OS keychain.
Sourcefn has_plaintext_secrets(&self) -> bool
fn has_plaintext_secrets(&self) -> bool
Returns true if the config struct currently contains any plaintext secrets.
Sourcefn hydrate_secrets_sync(&mut self) -> Result<()>
fn hydrate_secrets_sync(&mut self) -> Result<()>
Load secrets from keystore into the struct (sync).
Sourcefn hydrate_secrets(&mut self) -> impl Future<Output = Result<()>> + Send
fn hydrate_secrets(&mut self) -> impl Future<Output = Result<()>> + Send
Async version of hydrate secrets.
Sourcefn migrate_secrets_sync(&self) -> Result<bool>
fn migrate_secrets_sync(&self) -> Result<bool>
Move secrets from the struct (if present) to the keychain (sync).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.