Struct regex_automata::MultiMatch
source · [−]pub struct MultiMatch { /* private fields */ }
Expand description
A representation of a multi match reported by a regex engine.
A multi match has two essential pieces of information: the identifier of the pattern that matched, along with the start and end offsets of the match in the haystack.
The pattern is identified by an ID, which corresponds to its position
(starting from 0
) relative to other patterns used to construct the
corresponding regex engine. If only a single pattern is provided, then all
multi matches are guaranteed to have a pattern ID of 0
.
Every multi match guarantees that start <= end
.
Implementations
sourceimpl MultiMatch
impl MultiMatch
sourcepub fn must(pattern: usize, start: usize, end: usize) -> MultiMatch
pub fn must(pattern: usize, start: usize, end: usize) -> MultiMatch
Create a new match from a pattern ID and a byte offset span.
This is like MultiMatch::new
, but accepts a usize
instead of a
PatternID
. This panics if the given usize
is not representable
as a PatternID
.
Panics
This panics if end < start
or if pattern > PatternID::MAX
.
Trait Implementations
sourceimpl Clone for MultiMatch
impl Clone for MultiMatch
sourcefn clone(&self) -> MultiMatch
fn clone(&self) -> MultiMatch
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MultiMatch
impl Debug for MultiMatch
sourceimpl Hash for MultiMatch
impl Hash for MultiMatch
sourceimpl PartialEq<MultiMatch> for MultiMatch
impl PartialEq<MultiMatch> for MultiMatch
sourcefn eq(&self, other: &MultiMatch) -> bool
fn eq(&self, other: &MultiMatch) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MultiMatch) -> bool
fn ne(&self, other: &MultiMatch) -> bool
This method tests for !=
.
impl Eq for MultiMatch
impl StructuralEq for MultiMatch
impl StructuralPartialEq for MultiMatch
Auto Trait Implementations
impl RefUnwindSafe for MultiMatch
impl Send for MultiMatch
impl Sync for MultiMatch
impl Unpin for MultiMatch
impl UnwindSafe for MultiMatch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more