Struct tracing::level_filters::LevelFilter
source · [−]#[repr(transparent)]pub struct LevelFilter(_);
Expand description
A filter comparable to a verbosity Level
.
If a Level
is considered less than a LevelFilter
, it should be
considered enabled; if greater than or equal to the LevelFilter
,
that level is disabled. See LevelFilter::current
for more
details.
Note that this is essentially identical to the Level
type, but with the
addition of an OFF
level that completely disables all trace
instrumentation.
See the documentation for the Level
type to see how Level
s
and LevelFilter
s interact.
Implementations
sourceimpl LevelFilter
impl LevelFilter
sourcepub const OFF: LevelFilter
pub const OFF: LevelFilter
The “off” level.
Designates that trace instrumentation should be completely disabled.
sourcepub const ERROR: LevelFilter
pub const ERROR: LevelFilter
The “error” level.
Designates very serious errors.
sourcepub const WARN: LevelFilter
pub const WARN: LevelFilter
The “warn” level.
Designates hazardous situations.
sourcepub const INFO: LevelFilter
pub const INFO: LevelFilter
The “info” level.
Designates useful information.
sourcepub const DEBUG: LevelFilter
pub const DEBUG: LevelFilter
The “debug” level.
Designates lower priority information.
sourcepub const TRACE: LevelFilter
pub const TRACE: LevelFilter
The “trace” level.
Designates very low priority, often extremely verbose, information.
sourcepub const fn from_level(level: Level) -> LevelFilter
pub const fn from_level(level: Level) -> LevelFilter
Returns a LevelFilter
that enables spans and events with verbosity up
to and including level
.
sourcepub const fn into_level(self) -> Option<Level>
pub const fn into_level(self) -> Option<Level>
sourcepub fn current() -> LevelFilter
pub fn current() -> LevelFilter
Returns a LevelFilter
that matches the most verbose Level
that any
currently active Subscriber
will enable.
User code should treat this as a hint. If a given span or event has a
level higher than the returned LevelFilter
, it will not be enabled.
However, if the level is less than or equal to this value, the span or
event is not guaranteed to be enabled; the subscriber will still
filter each callsite individually.
Therefore, comparing a given span or event’s level to the returned
LevelFilter
can be used for determining if something is
disabled, but should not be used for determining if something is
enabled.
Trait Implementations
sourceimpl Clone for LevelFilter
impl Clone for LevelFilter
sourcepub fn clone(&self) -> LevelFilter
pub fn clone(&self) -> LevelFilter
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LevelFilter
impl Debug for LevelFilter
sourceimpl Display for LevelFilter
impl Display for LevelFilter
sourceimpl From<Level> for LevelFilter
impl From<Level> for LevelFilter
sourcepub fn from(level: Level) -> LevelFilter
pub fn from(level: Level) -> LevelFilter
Performs the conversion.
sourceimpl From<LevelFilter> for Option<Level>
impl From<LevelFilter> for Option<Level>
sourcepub fn from(filter: LevelFilter) -> Option<Level>
pub fn from(filter: LevelFilter) -> Option<Level>
Performs the conversion.
sourceimpl From<Option<Level>> for LevelFilter
impl From<Option<Level>> for LevelFilter
sourcepub fn from(level: Option<Level>) -> LevelFilter
pub fn from(level: Option<Level>) -> LevelFilter
Performs the conversion.
sourceimpl FromStr for LevelFilter
impl FromStr for LevelFilter
type Err = ParseLevelFilterError
type Err = ParseLevelFilterError
The associated error which can be returned from parsing.
sourcepub fn from_str(
from: &str
) -> Result<LevelFilter, <LevelFilter as FromStr>::Err>
pub fn from_str(
from: &str
) -> Result<LevelFilter, <LevelFilter as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
sourceimpl Hash for LevelFilter
impl Hash for LevelFilter
sourceimpl Ord for LevelFilter
impl Ord for LevelFilter
sourceimpl PartialEq<Level> for LevelFilter
impl PartialEq<Level> for LevelFilter
sourceimpl PartialEq<LevelFilter> for LevelFilter
impl PartialEq<LevelFilter> for LevelFilter
sourcepub fn eq(&self, other: &LevelFilter) -> bool
pub fn eq(&self, other: &LevelFilter) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &LevelFilter) -> bool
pub fn ne(&self, other: &LevelFilter) -> bool
This method tests for !=
.
sourceimpl PartialEq<LevelFilter> for Level
impl PartialEq<LevelFilter> for Level
sourceimpl PartialOrd<Level> for LevelFilter
impl PartialOrd<Level> for LevelFilter
sourcepub fn partial_cmp(&self, other: &Level) -> Option<Ordering>
pub fn partial_cmp(&self, other: &Level) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcepub fn lt(&self, other: &Level) -> bool
pub fn lt(&self, other: &Level) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcepub fn le(&self, other: &Level) -> bool
pub fn le(&self, other: &Level) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PartialOrd<LevelFilter> for LevelFilter
impl PartialOrd<LevelFilter> for LevelFilter
sourcepub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
pub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcepub fn lt(&self, other: &LevelFilter) -> bool
pub fn lt(&self, other: &LevelFilter) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcepub fn le(&self, other: &LevelFilter) -> bool
pub fn le(&self, other: &LevelFilter) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourcepub fn gt(&self, other: &LevelFilter) -> bool
pub fn gt(&self, other: &LevelFilter) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
sourcepub fn ge(&self, other: &LevelFilter) -> bool
pub fn ge(&self, other: &LevelFilter) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
sourceimpl PartialOrd<LevelFilter> for Level
impl PartialOrd<LevelFilter> for Level
sourcepub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
pub fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
sourcepub fn lt(&self, other: &LevelFilter) -> bool
pub fn lt(&self, other: &LevelFilter) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
sourcepub fn le(&self, other: &LevelFilter) -> bool
pub fn le(&self, other: &LevelFilter) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourcepub fn gt(&self, other: &LevelFilter) -> bool
pub fn gt(&self, other: &LevelFilter) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
sourcepub fn ge(&self, other: &LevelFilter) -> bool
pub fn ge(&self, other: &LevelFilter) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Copy for LevelFilter
impl Eq for LevelFilter
impl StructuralEq for LevelFilter
impl StructuralPartialEq for LevelFilter
Auto Trait Implementations
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnwindSafe for LevelFilter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T: Future> Future for Instrumented<T> type Output = T::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T: Future> Future for Instrumented<T> type Output = T::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T: Future> Future for Instrumented<T> type Output = T::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T: Future> Future for Instrumented<T> type Output = T::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T: Future> Future for WithDispatch<T> type Output = T::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T: Future> Future for WithDispatch<T> type Output = T::Output;
where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T: Future> Future for WithDispatch<T> type Output = T::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T: Future> Future for WithDispatch<T> type Output = T::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more