Struct grok::Grok

source · []
pub struct Grok { /* private fields */ }
Expand description

The Grok struct is the main entry point into using this library.

Implementations

Creates a new Grok instance with no patterns.

Creates a new Grok instance and loads all the default patterns.

Adds a custom pattern.

Compiles the given pattern, making it ready for matching.

Trait Implementations

Formats the value using the given formatter. Read more

The Default implementation for Grok whuich will load the default patterns.

Returns the “default value” for a type. Read more

Allows to construct Grok with an array of patterns directly.

Example:

let mut grok = Grok::from([("USERNAME", r"[a-zA-Z0-9._-]+")]);

Converts to this type from the input type.

Allows to initialize Grok with an iterator of patterns.

Example:

let patterns = [("USERNAME", r"[a-zA-Z0-9._-]+")];
let mut grok = Grok::from_iter(patterns.into_iter());

Creates a value from an iterator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.