Skip to main content

MinLevelPathMap

Struct MinLevelPathMap 

Source
pub struct MinLevelPathMap<L = Level> { /* private fields */ }
Expand description

A filter that applies a MinLevelFilter based on the module of an event.

This type allows different modules to apply different level filters. In particular, modules generating a lot of diagnostic noise can be silenced without affecting other modules.

Event modules are matched based on Path::is_child_of. If an event’s module is a child of one in the map then its MinLevelFilter will be checked against it. If an event’s module doesn’t match any in the map then it will pass the filter.

Implementations§

Source§

impl<L> MinLevelPathMap<L>

Source

pub const fn new() -> Self

Create an empty map.

Source

pub fn default_min_level( &mut self, min_level: impl Into<MinLevelFilter<L>>, ) -> &mut Self

Specify the minimum level for any modules that don’t match any added by MinLevelPathMap::min_level.

Source

pub fn min_level( &mut self, path: impl Into<Path<'static>>, min_level: impl Into<MinLevelFilter<L>>, ) -> &mut Self

Specify the minimum level for a module and its children.

Trait Implementations§

Source§

impl<L: Debug> Debug for MinLevelPathMap<L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L: for<'a> FromValue<'a> + Ord + Default> Filter for MinLevelPathMap<L>

Source§

fn matches<E: ToEvent>(&self, evt: E) -> bool

Evaluate an event against the filter. Read more
Source§

fn and_when<U>(self, other: U) -> And<Self, U>
where Self: Sized,

self && other. Read more
Source§

fn or_when<U>(self, other: U) -> Or<Self, U>
where Self: Sized,

self || other. Read more
Source§

impl<L, P: Into<Path<'static>>, T: Into<MinLevelFilter<L>>> FromIterator<(P, T)> for MinLevelPathMap<L>

Source§

fn from_iter<I: IntoIterator<Item = (P, T)>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl InternalFilter for MinLevelPathMap

Auto Trait Implementations§

§

impl<L> Freeze for MinLevelPathMap<L>
where L: Freeze,

§

impl<L> RefUnwindSafe for MinLevelPathMap<L>
where L: RefUnwindSafe,

§

impl<L> Send for MinLevelPathMap<L>
where L: Send,

§

impl<L> Sync for MinLevelPathMap<L>
where L: Sync,

§

impl<L> Unpin for MinLevelPathMap<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for MinLevelPathMap<L>
where L: UnsafeUnpin,

§

impl<L> UnwindSafe for MinLevelPathMap<L>
where L: UnwindSafe,

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> 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> ErasedFilter for T
where T: Filter,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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>,

Source§

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>,

Source§

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.