pub struct SystemEnvProvider;Expand description
System environment provider using std::env::var
This is the production implementation that delegates to the standard library’s environment variable access. It reads from the actual process environment.
§Thread Safety
This implementation is thread-safe and can be safely shared across threads. Reading environment variables in Rust is thread-safe, though writing to them requires unsafe code.
§Examples
use sublime_git_tools::{EnvProvider, SystemEnvProvider};
use std::sync::Arc;
let env = Arc::new(SystemEnvProvider);
let home = env.var("HOME").expect("HOME should be set");
println!("Home directory: {}", home);Trait Implementations§
Source§impl Clone for SystemEnvProvider
impl Clone for SystemEnvProvider
Source§fn clone(&self) -> SystemEnvProvider
fn clone(&self) -> SystemEnvProvider
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 SystemEnvProvider
impl Debug for SystemEnvProvider
Source§impl Default for SystemEnvProvider
impl Default for SystemEnvProvider
Source§fn default() -> SystemEnvProvider
fn default() -> SystemEnvProvider
Returns the “default value” for a type. Read more
Source§impl EnvProvider for SystemEnvProvider
impl EnvProvider for SystemEnvProvider
impl Copy for SystemEnvProvider
Auto Trait Implementations§
impl Freeze for SystemEnvProvider
impl RefUnwindSafe for SystemEnvProvider
impl Send for SystemEnvProvider
impl Sync for SystemEnvProvider
impl Unpin for SystemEnvProvider
impl UnwindSafe for SystemEnvProvider
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