[−][src]Struct grep_matcher::ByteSet
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.
Methods
impl ByteSet
[src]
pub fn empty() -> ByteSet
[src]
Create an empty set of bytes.
pub fn full() -> ByteSet
[src]
Create a full set of bytes such that every possible byte is in the set returned.
pub fn add(&mut self, byte: u8)
[src]
Add a byte to this set.
If the given byte already belongs to this set, then this is a no-op.
pub fn add_all(&mut self, start: u8, end: u8)
[src]
Add an inclusive range of bytes.
pub fn remove(&mut self, byte: u8)
[src]
Remove a byte from this set.
If the given byte is not in this set, then this is a no-op.
pub fn remove_all(&mut self, start: u8, end: u8)
[src]
Remove an inclusive range of bytes.
pub fn contains(&self, byte: u8) -> bool
[src]
Return true if and only if the given byte is in this set.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ByteSet
impl Send for ByteSet
impl Sync for ByteSet
impl Unpin for ByteSet
impl UnwindSafe for ByteSet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,