Struct grep_matcher::ByteSet [−][src]
pub struct 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]
impl ByteSet
pub fn empty() -> ByteSet
[src]
pub fn empty() -> ByteSet
Create an empty set of bytes.
pub fn full() -> ByteSet
[src]
pub fn full() -> ByteSet
Create a full set of bytes such that every possible byte is in the set returned.
pub fn add(&mut self, byte: u8)
[src]
pub fn add(&mut self, byte: u8)
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]
pub fn add_all(&mut self, start: u8, end: u8)
Add an inclusive range of bytes.
pub fn remove(&mut self, byte: u8)
[src]
pub fn remove(&mut self, byte: u8)
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]
pub fn remove_all(&mut self, start: u8, end: u8)
Remove an inclusive range of bytes.
pub fn contains(&self, byte: u8) -> bool
[src]
pub fn contains(&self, byte: u8) -> bool
Return true if and only if the given byte is in this set.
Trait Implementations
impl Clone for ByteSet
[src]
impl Clone for ByteSet
fn clone(&self) -> ByteSet
[src]
fn clone(&self) -> ByteSet
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ByteSet
[src]
impl Debug for ByteSet