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§
Sourcefn enabled(
&self,
metadata: &Metadata<'_>,
diags: &[Box<dyn Diagnostic>],
) -> FilterResult
fn enabled( &self, metadata: &Metadata<'_>, diags: &[Box<dyn Diagnostic>], ) -> FilterResult
Whether the record is filtered by its given metadata.
Provided Methods§
Sourcefn matches(
&self,
record: &Record<'_>,
diags: &[Box<dyn Diagnostic>],
) -> FilterResult
fn matches( &self, record: &Record<'_>, diags: &[Box<dyn Diagnostic>], ) -> FilterResult
Whether the record is filtered.