pub struct EnvironmentConfig {
pub auths_home: Option<PathBuf>,
pub keychain: KeychainConfig,
pub ssh_agent_socket: Option<PathBuf>,
}Expand description
Full environment configuration for an Auths process.
Collect all environment-variable inputs at the process boundary (main, FFI entry)
and thread this struct through the call graph. Subsystems accept &EnvironmentConfig
instead of reading env vars directly.
Usage:
ⓘ
let env = EnvironmentConfig::from_env();
let home = auths_home_with_config(&env)?;
let keychain = get_platform_keychain_with_config(&env)?;Fields§
§auths_home: Option<PathBuf>Override for the Auths home directory (AUTHS_HOME).
None falls back to ~/.auths.
keychain: KeychainConfigKeychain backend settings.
ssh_agent_socket: Option<PathBuf>Path to the SSH agent socket (SSH_AUTH_SOCK).
Implementations§
Source§impl EnvironmentConfig
impl EnvironmentConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build an EnvironmentConfig from the process environment.
Reads AUTHS_HOME, AUTHS_KEYCHAIN_BACKEND, AUTHS_KEYCHAIN_FILE,
AUTHS_PASSPHRASE, and SSH_AUTH_SOCK.
Usage:
ⓘ
let env = EnvironmentConfig::from_env();Sourcepub fn builder() -> EnvironmentConfigBuilder
pub fn builder() -> EnvironmentConfigBuilder
Returns a builder for constructing test configurations without env vars.
Usage:
ⓘ
let env = EnvironmentConfig::builder()
.auths_home(temp_dir.path().to_path_buf())
.build();Trait Implementations§
Source§impl Clone for EnvironmentConfig
impl Clone for EnvironmentConfig
Source§fn clone(&self) -> EnvironmentConfig
fn clone(&self) -> EnvironmentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnvironmentConfig
impl Debug for EnvironmentConfig
Source§impl Default for EnvironmentConfig
impl Default for EnvironmentConfig
Source§fn default() -> EnvironmentConfig
fn default() -> EnvironmentConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnvironmentConfig
impl RefUnwindSafe for EnvironmentConfig
impl Send for EnvironmentConfig
impl Sync for EnvironmentConfig
impl Unpin for EnvironmentConfig
impl UnsafeUnpin for EnvironmentConfig
impl UnwindSafe for EnvironmentConfig
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