pub struct Env<'a> { /* private fields */ }
Expand description
Set of environment variables to configure from.
§Default environment variables
By default, the Env
will read the following environment variables:
RUST_LOG
: the level filterRUST_LOG_STYLE
: whether or not to print styles with records.
These sources can be configured using the builder methods on Env
.
Implementations§
Source§impl<'a> Env<'a>
impl<'a> Env<'a>
Sourcepub fn filter<E>(self, filter_env: E) -> Env<'a>
pub fn filter<E>(self, filter_env: E) -> Env<'a>
Specify an environment variable to read the filter from.
Sourcepub fn filter_or<E, V>(self, filter_env: E, default: V) -> Env<'a>
pub fn filter_or<E, V>(self, filter_env: E, default: V) -> Env<'a>
Specify an environment variable to read the filter from.
If the variable is not set, the default value will be used.
Sourcepub fn default_filter_or<V>(self, default: V) -> Env<'a>
pub fn default_filter_or<V>(self, default: V) -> Env<'a>
Use the default environment variable to read the filter from.
If the variable is not set, the default value will be used.
Sourcepub fn write_style<E>(self, write_style_env: E) -> Env<'a>
pub fn write_style<E>(self, write_style_env: E) -> Env<'a>
Specify an environment variable to read the style from.
Sourcepub fn write_style_or<E, V>(self, write_style_env: E, default: V) -> Env<'a>
pub fn write_style_or<E, V>(self, write_style_env: E, default: V) -> Env<'a>
Specify an environment variable to read the style from.
If the variable is not set, the default value will be used.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Env<'a>
impl<'a> RefUnwindSafe for Env<'a>
impl<'a> Send for Env<'a>
impl<'a> Sync for Env<'a>
impl<'a> Unpin for Env<'a>
impl<'a> UnwindSafe for Env<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more