emit::level

Struct MinLevelFilter

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

A Filter that matches events with a specific Level.

The level to match is pulled from the KEY_LVL well-known property. Events that don’t carry any specific level are treated as carrying a default one, as set by MinLevelFilter::treat_unleveled_as.

Implementations§

Source§

impl<L> MinLevelFilter<L>

Source

pub const fn new(min: L) -> MinLevelFilter<L>

Construct a new MinLevelFilter, treating unleveled events as Level::default.

Source

pub fn treat_unleveled_as(self, default: L) -> Self

Treat events without an explicit level as having default when evaluating against the filter.

Trait Implementations§

Source§

impl<L: Debug> Debug for MinLevelFilter<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 MinLevelFilter<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 From<Level> for MinLevelFilter

Source§

fn from(min: Level) -> Self

Converts to this type from the input type.
Source§

impl InternalFilter for MinLevelFilter

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<L> UnwindSafe for MinLevelFilter<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> 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedFilter for T
where T: Filter,