pub struct Grok { /* private fields */ }
Expand description
The Grok
struct is the main entry point into using this library.
Implementations
sourceimpl Grok
impl Grok
sourcepub fn with_default_patterns() -> Self
pub fn with_default_patterns() -> Self
Creates a new Grok
instance and loads all the default patterns.
sourcepub fn add_pattern<S: Into<String>>(&mut self, name: S, pattern: S)
pub fn add_pattern<S: Into<String>>(&mut self, name: S, pattern: S)
Adds a custom pattern.
Trait Implementations
sourceimpl Default for Grok
impl Default for Grok
The Default implementation for Grok whuich will load the default patterns.
sourceimpl<S: Into<String>, const N: usize> From<[(S, S); N]> for Grok
impl<S: Into<String>, const N: usize> From<[(S, S); N]> for Grok
Allows to construct Grok with an array of patterns directly.
Example:
let mut grok = Grok::from([("USERNAME", r"[a-zA-Z0-9._-]+")]);
Auto Trait Implementations
impl RefUnwindSafe for Grok
impl Send for Grok
impl Sync for Grok
impl Unpin for Grok
impl UnwindSafe for Grok
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more