Struct mockable::DefaultEnv

source ·
pub struct DefaultEnv;
Expand description

Default implementation of Env.

Example.

Trait Implementations§

source§

impl Env for DefaultEnv

source§

fn all(&self) -> HashMap<String, String>

Returns all environment variables. Read more
source§

fn bool(&self, key: &str) -> Option<Result<bool, ParseBoolError>>

Returns the value of the environment variable key as a bool. Read more
source§

fn char(&self, key: &str) -> Option<Result<char, ParseCharError>>

Returns the value of the environment variable key as a char. Read more
source§

fn f32(&self, key: &str) -> Option<Result<f32, ParseFloatError>>

Returns the value of the environment variable key as a f32. Read more
source§

fn f64(&self, key: &str) -> Option<Result<f64, ParseFloatError>>

Returns the value of the environment variable key as a f64. Read more
source§

fn i8(&self, key: &str) -> Option<Result<i8, ParseIntError>>

Returns the value of the environment variable key as a i8. Read more
source§

fn i16(&self, key: &str) -> Option<Result<i16, ParseIntError>>

Returns the value of the environment variable key as a i16. Read more
source§

fn i32(&self, key: &str) -> Option<Result<i32, ParseIntError>>

Returns the value of the environment variable key as a i32. Read more
source§

fn i64(&self, key: &str) -> Option<Result<i64, ParseIntError>>

Returns the value of the environment variable key as a i64. Read more
source§

fn i128(&self, key: &str) -> Option<Result<i128, ParseIntError>>

Returns the value of the environment variable key as a i128. Read more
source§

fn ip_addr(&self, key: &str) -> Option<Result<IpAddr, AddrParseError>>

Returns the value of the environment variable key as a IpAddr. Read more
source§

fn ipv4_addr(&self, key: &str) -> Option<Result<Ipv4Addr, AddrParseError>>

Returns the value of the environment variable key as a Ipv4Addr. Read more
source§

fn ipv6_addr(&self, key: &str) -> Option<Result<Ipv6Addr, AddrParseError>>

Returns the value of the environment variable key as a Ipv6Addr. Read more
source§

fn isize(&self, key: &str) -> Option<Result<isize, ParseIntError>>

Returns the value of the environment variable key as a isize. Read more
source§

fn non_zero_i8(&self, key: &str) -> Option<Result<NonZeroI8, ParseIntError>>

Returns the value of the environment variable key as a NonZeroI8. Read more
source§

fn non_zero_i16(&self, key: &str) -> Option<Result<NonZeroI16, ParseIntError>>

Returns the value of the environment variable key as a NonZeroI16. Read more
source§

fn non_zero_i32(&self, key: &str) -> Option<Result<NonZeroI32, ParseIntError>>

Returns the value of the environment variable key as a NonZeroI32. Read more
source§

fn non_zero_i64(&self, key: &str) -> Option<Result<NonZeroI64, ParseIntError>>

Returns the value of the environment variable key as a NonZeroI64. Read more
source§

fn non_zero_i128(&self, key: &str) -> Option<Result<NonZeroI128, ParseIntError>>

Returns the value of the environment variable key as a NonZeroI128. Read more
source§

fn non_zero_isize( &self, key: &str ) -> Option<Result<NonZeroIsize, ParseIntError>>

Returns the value of the environment variable key as a NonZeroIsize. Read more
source§

fn non_zero_u8(&self, key: &str) -> Option<Result<NonZeroU8, ParseIntError>>

Returns the value of the environment variable key as a NonZeroU8. Read more
source§

fn non_zero_u16(&self, key: &str) -> Option<Result<NonZeroU16, ParseIntError>>

Returns the value of the environment variable key as a NonZeroU16. Read more
source§

fn non_zero_u32(&self, key: &str) -> Option<Result<NonZeroU32, ParseIntError>>

Returns the value of the environment variable key as a NonZeroU32. Read more
source§

fn non_zero_u64(&self, key: &str) -> Option<Result<NonZeroU64, ParseIntError>>

Returns the value of the environment variable key as a NonZeroU64. Read more
source§

fn non_zero_u128(&self, key: &str) -> Option<Result<NonZeroU128, ParseIntError>>

Returns the value of the environment variable key as a NonZeroU128. Read more
source§

fn non_zero_usize( &self, key: &str ) -> Option<Result<NonZeroUsize, ParseIntError>>

Returns the value of the environment variable key as a NonZeroUsize. Read more
source§

fn os_string(&self, key: &str) -> Option<OsString>

Returns the value of the environment variable key as a OsString. Read more
source§

fn path_buf(&self, key: &str) -> Option<PathBuf>

Returns the value of the environment variable key as a PathBuf. Read more
source§

fn raw(&self, key: &str) -> Result<String, VarError>

Returns the value of the environment variable key as a String. Read more
source§

fn socket_addr(&self, key: &str) -> Option<Result<SocketAddr, AddrParseError>>

Returns the value of the environment variable key as a SocketAddr. Read more
source§

fn socket_addr_v4( &self, key: &str ) -> Option<Result<SocketAddrV4, AddrParseError>>

Returns the value of the environment variable key as a SocketAddrV4. Read more
source§

fn socket_addr_v6( &self, key: &str ) -> Option<Result<SocketAddrV6, AddrParseError>>

Returns the value of the environment variable key as a SocketAddrV6. Read more
source§

fn string(&self, key: &str) -> Option<String>

Returns the value of the environment variable key as a String. Read more
source§

fn strings(&self, key: &str, sep: &str) -> Option<Vec<String>>

Returns the value of the environment variable key as a Vec<String>. Read more
source§

fn u8(&self, key: &str) -> Option<Result<u8, ParseIntError>>

Returns the value of the environment variable key as a u8. Read more
source§

fn u16(&self, key: &str) -> Option<Result<u16, ParseIntError>>

Returns the value of the environment variable key as a u16. Read more
source§

fn u32(&self, key: &str) -> Option<Result<u32, ParseIntError>>

Returns the value of the environment variable key as a u32. Read more
source§

fn u64(&self, key: &str) -> Option<Result<u64, ParseIntError>>

Returns the value of the environment variable key as a u64. Read more
source§

fn u128(&self, key: &str) -> Option<Result<u128, ParseIntError>>

Returns the value of the environment variable key as a u128. Read more
source§

fn usize(&self, key: &str) -> Option<Result<usize, ParseIntError>>

Returns the value of the environment variable key as a usize. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Any for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

source§

impl<T> AnySync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more