The Pattern
struct represents an uncompiled pattern. Patterns
are essentially RegEx searches; given an expression, they theoretically
will match text. Note that in order for patterns to actually match text,
they must first be compiled. (See CompiledPattern
).
The pattern to match; either plaintext or a regular expression,
depending on the value of kind
. Note that RegEx lookbacks are not
supported; all RegEx expressions must search in linear time. See the
Rust regex
documentation for more information.
Represents the type of pattern; i.e. RegEx or Raw.
Given any pattern, this function returns its expression
as safe-to-compile RegEx. For Raw
patterns, the expression
is escaped; for RegEx
patterns, it is cloned. Note that this
function does not validate whether the RegEx is valid; it simply
prepares it for compilation.
This is a utility function, and is currently not used during
compilation.
This function determines whether the Pattern
is valid.
It performs a compilation check for itself and for its RegEx.
Returns None
if there is no issue; otherwise, Some(Vec<Issue>)
.
This function compiles the Pattern
into a CompiledPattern
by
escaping the RegEx expression as necessary and then compiling it.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Serialize this value into the given Serde serializer. Read more
Deserialize this value from the given Serde deserializer. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static