pub struct MatchError(_);
Expand description

An error that occurred during an Aho-Corasick search.

An error that occurs during a search is limited to some kind of misconfiguration that resulted in an illegal call. Stated differently, whether an error occurs is not dependent on the specific bytes in the haystack.

Examples of misconfiguration:

  • Executing a stream or overlapping search on a searcher that was built was something other than MatchKind::Standard semantics.
  • Requested an anchored or an unanchored search on a searcher that doesn’t support unanchored or anchored searches, respectively.

When the std feature is enabled, this implements the std::error::Error trait.

Implementations

Create a new error value with the given kind.

This is a more verbose version of the kind-specific constructors, e.g., MatchError::unsupported_stream.

Returns a reference to the underlying error kind.

Create a new “invalid anchored search” error. This occurs when the caller requests an anchored search but where anchored searches aren’t supported.

This is the same as calling MatchError::new with a MatchErrorKind::InvalidInputAnchored kind.

Create a new “invalid unanchored search” error. This occurs when the caller requests an unanchored search but where unanchored searches aren’t supported.

This is the same as calling MatchError::new with a MatchErrorKind::InvalidInputUnanchored kind.

Create a new “unsupported stream search” error. This occurs when the caller requests a stream search while using an Aho-Corasick automaton with a match kind other than MatchKind::Standard.

The match kind given should be the match kind of the automaton. It should never be MatchKind::Standard.

Create a new “unsupported overlapping search” error. This occurs when the caller requests an overlapping search while using an Aho-Corasick automaton with a match kind other than MatchKind::Standard.

The match kind given should be the match kind of the automaton. It should never be MatchKind::Standard.

Create a new “unsupported empty pattern” error. This occurs when the caller requests a search for which matching an automaton that contains an empty pattern string is not supported.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.