pub struct CompiledFilter {
pub format_name: String,
/* private fields */
}Expand description
A compiled filter bound to a specific format. Evaluating a line runs the format’s regex once and applies all predicates against the resulting captures. AND semantics: a line matches iff every predicate matches.
Fields§
§format_name: StringImplementations§
Source§impl CompiledFilter
impl CompiledFilter
Sourcepub fn compile(
format: &LogFormat,
specs: Vec<FilterSpec>,
) -> Result<Self, String>
pub fn compile( format: &LogFormat, specs: Vec<FilterSpec>, ) -> Result<Self, String>
Compile the given specs against format. Validates that every spec’s
field is one of the format’s named captures.
Sourcepub fn evaluate(&self, line: &[u8]) -> FilterMatch
pub fn evaluate(&self, line: &[u8]) -> FilterMatch
Evaluate the filter against a single logical line of bytes. Decodes the line as UTF-8 with a lossy fallback so non-UTF-8 bytes can still flow through (they just won’t match string-equal predicates).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledFilter
impl RefUnwindSafe for CompiledFilter
impl Send for CompiledFilter
impl Sync for CompiledFilter
impl Unpin for CompiledFilter
impl UnsafeUnpin for CompiledFilter
impl UnwindSafe for CompiledFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more