#[non_exhaustive]pub struct PositionedMatch {
pub start: usize,
pub end: usize,
pub pattern_index: usize,
}Expand description
Where one match lies in the searched text: byte offsets plus the index of the pattern that matched.
Produced by CompiledMatcher::find_positions and
CompiledMatcher::push_positions. It is Copy and borrows nothing, so
producing it never allocates. pattern_index is the pattern’s insertion
position, as used by CompiledMatcher::patterns,
CompiledMatcher::pattern and CompiledMatcher::term.
The derived ordering compares start, then end, then pattern_index:
the order in which MatchOverlap::All results are reported.
Marked #[non_exhaustive] so fields can be added in a minor release; read
the public fields directly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.start: usizeByte offset of the first byte of the match (on a char boundary).
end: usizeByte offset one past the last byte of the match (on a char
boundary).
pattern_index: usizeInsertion index of the pattern that matched.
Implementations§
Source§impl PositionedMatch
impl PositionedMatch
Trait Implementations§
Source§impl Clone for PositionedMatch
impl Clone for PositionedMatch
impl Copy for PositionedMatch
Source§impl Debug for PositionedMatch
impl Debug for PositionedMatch
impl Eq for PositionedMatch
Source§impl From<Match> for PositionedMatch
impl From<Match> for PositionedMatch
Source§impl Hash for PositionedMatch
impl Hash for PositionedMatch
Source§impl Ord for PositionedMatch
impl Ord for PositionedMatch
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PositionedMatch
impl PartialEq for PositionedMatch
Source§impl PartialOrd for PositionedMatch
impl PartialOrd for PositionedMatch
impl StructuralPartialEq for PositionedMatch
Auto Trait Implementations§
impl Freeze for PositionedMatch
impl RefUnwindSafe for PositionedMatch
impl Send for PositionedMatch
impl Sync for PositionedMatch
impl Unpin for PositionedMatch
impl UnsafeUnpin for PositionedMatch
impl UnwindSafe for PositionedMatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.