Struct grep_matcher::ByteSet

source ·
pub struct ByteSet(_);
Expand description

A set of bytes.

In this crate, byte sets are used to express bytes that can never appear anywhere in a match for a particular implementation of the Matcher trait. Specifically, if such a set can be determined, then it’s possible for callers to perform additional operations on the basis that certain bytes may never match.

For example, if a search is configured to possibly produce results that span multiple lines but a caller provided pattern can never match across multiple lines, then it may make sense to divert to more optimized line oriented routines that don’t need to handle the multi-line match case.

Implementations§

Create an empty set of bytes.

Create a full set of bytes such that every possible byte is in the set returned.

Add a byte to this set.

If the given byte already belongs to this set, then this is a no-op.

Add an inclusive range of bytes.

Remove a byte from this set.

If the given byte is not in this set, then this is a no-op.

Remove an inclusive range of bytes.

Return true if and only if the given byte is in this set.

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

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 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
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.