Filter

Trait Filter 

Source
pub trait Filter:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn enabled(
        &self,
        metadata: &Metadata<'_>,
        diags: &[Box<dyn Diagnostic>],
    ) -> FilterResult;

    // Provided method
    fn matches(
        &self,
        record: &Record<'_>,
        diags: &[Box<dyn Diagnostic>],
    ) -> FilterResult { ... }
}
Expand description

A filter that can be applied to log records.

Required Methods§

Source

fn enabled( &self, metadata: &Metadata<'_>, diags: &[Box<dyn Diagnostic>], ) -> FilterResult

Whether the record is filtered by its given metadata.

Provided Methods§

Source

fn matches( &self, record: &Record<'_>, diags: &[Box<dyn Diagnostic>], ) -> FilterResult

Whether the record is filtered.

Implementors§