Enum LevelFilter
#[repr(usize)]
pub enum LevelFilter
An enum representing the available verbosity level filters of the logger.
A LevelFilter may be compared directly to a Level. Use this type
to get and set the maximum log level with max_level() and set_max_level.
Variants
-
Off A level lower than all log levels.
-
Error Corresponds to the
Errorlog level.-
Warn Corresponds to the
Warnlog level.-
Info Corresponds to the
Infolog level.-
Debug Corresponds to the
Debuglog level.-
Trace Corresponds to the
Tracelog level.
Implementations
impl LevelFilter
fn max() -> LevelFilterReturns the most verbose logging level filter.
fn to_level(&self) -> Option<Level>Converts
selfto the equivalentLevel.Returns
NoneifselfisLevelFilter::Off.fn as_str(&self) -> &'static strReturns the string representation of the
LevelFilter.This returns the same string as the
fmt::Displayimplementation.fn iter() -> impl Iterator<Item = Self>Iterate through all supported filtering levels.
The order of iteration is from less to more verbose filtering.
Examples
use LevelFilter; let mut levels = iter; assert_eq!; assert_eq!;fn increment_severity(&self) -> SelfGet the next-highest
LevelFilterfrom this one.If the current
LevelFilteris at the highest level, the returnedLevelFilterwill be the same as the current one.Examples
use LevelFilter; let level_filter = Info; assert_eq!; assert_eq!; assert_eq!; // max levelfn decrement_severity(&self) -> SelfGet the next-lowest
LevelFilterfrom this one.If the current
LevelFilteris at the lowest level, the returnedLevelFilterwill be the same as the current one.Examples
use LevelFilter; let level_filter = Info; assert_eq!; assert_eq!; assert_eq!; assert_eq!; // min level
Trait Implementations
impl Clone for LevelFilter
fn clone(&self) -> LevelFilter
impl Copy for LevelFilter
impl Debug for LevelFilter
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for LevelFilter
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
impl Eq for LevelFilter
impl FromStr for LevelFilter
type Err = ParseLevelError;fn from_str(level: &str) -> Result<LevelFilter, Self::Err>
impl Hash for LevelFilter
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for LevelFilter
fn cmp(&self, other: &LevelFilter) -> Ordering
impl PartialEq for LevelFilter
fn eq(&self, other: &LevelFilter) -> bool
impl PartialEq<Level> for LevelFilter
fn eq(&self, other: &Level) -> bool
impl PartialOrd for LevelFilter
fn partial_cmp(&self, other: &LevelFilter) -> Option<Ordering>
impl PartialOrd<Level> for LevelFilter
fn partial_cmp(&self, other: &Level) -> Option<Ordering>
impl Serialize for LevelFilter
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer,
impl StructuralPartialEq for LevelFilter
impl<'de> Deserialize<'de> for LevelFilter
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>,
Auto Trait Implementations
impl Freeze for LevelFilter
impl RefUnwindSafe for LevelFilter
impl Send for LevelFilter
impl Sync for LevelFilter
impl Unpin for LevelFilter
impl UnsafeUnpin for LevelFilter
impl UnwindSafe for LevelFilter
Blanket Implementations
impl<T> Any for LevelFilter
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for LevelFilter
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for LevelFilter
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for LevelFilter
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> DeserializeOwned for LevelFilter
where
T: for<'de> Deserialize<'de>,
impl<T> From<T> for LevelFilter
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for LevelFilter
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for LevelFilter
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for LevelFilter
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for LevelFilter
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for LevelFilter
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>