[−][src]Enum regex_syntax::utf8::Utf8Sequence
Utf8Sequence represents a sequence of byte ranges.
To match a Utf8Sequence, a candidate byte sequence must match each successive range.
For example, if there are two ranges, [C2-DF][80-BF]
, then the byte
sequence \xDD\x61
would not match because 0x61 < 0x80
.
Variants
One(Utf8Range)
One byte range.
Two successive byte ranges.
Three successive byte ranges.
Four successive byte ranges.
Implementations
impl Utf8Sequence
[src]
pub fn as_slice(&self) -> &[Utf8Range]
[src]
Returns the underlying sequence of byte ranges as a slice.
pub fn len(&self) -> usize
[src]
Returns the number of byte ranges in this sequence.
The length is guaranteed to be in the closed interval [1, 4]
.
pub fn reverse(&mut self)
[src]
Reverses the ranges in this sequence.
For example, if this corresponds to the following sequence:
[D0-D3][80-BF]
Then after reversal, it will be
[80-BF][D0-D3]
This is useful when one is constructing a UTF-8 automaton to match character classes in reverse.
pub fn matches(&self, bytes: &[u8]) -> bool
[src]
Returns true if and only if a prefix of bytes
matches this sequence
of byte ranges.
Trait Implementations
impl Clone for Utf8Sequence
[src]
fn clone(&self) -> Utf8Sequence
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Utf8Sequence
[src]
impl Debug for Utf8Sequence
[src]
impl Eq for Utf8Sequence
[src]
impl<'a> IntoIterator for &'a Utf8Sequence
[src]
type IntoIter = Iter<'a, Utf8Range>
Which kind of iterator are we turning this into?
type Item = &'a Utf8Range
The type of the elements being iterated over.
fn into_iter(self) -> Self::IntoIter
[src]
impl Ord for Utf8Sequence
[src]
fn cmp(&self, other: &Utf8Sequence) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Utf8Sequence> for Utf8Sequence
[src]
fn eq(&self, other: &Utf8Sequence) -> bool
[src]
fn ne(&self, other: &Utf8Sequence) -> bool
[src]
impl PartialOrd<Utf8Sequence> for Utf8Sequence
[src]
fn partial_cmp(&self, other: &Utf8Sequence) -> Option<Ordering>
[src]
fn lt(&self, other: &Utf8Sequence) -> bool
[src]
fn le(&self, other: &Utf8Sequence) -> bool
[src]
fn gt(&self, other: &Utf8Sequence) -> bool
[src]
fn ge(&self, other: &Utf8Sequence) -> bool
[src]
impl StructuralEq for Utf8Sequence
[src]
impl StructuralPartialEq for Utf8Sequence
[src]
Auto Trait Implementations
impl RefUnwindSafe for Utf8Sequence
impl Send for Utf8Sequence
impl Sync for Utf8Sequence
impl Unpin for Utf8Sequence
impl UnwindSafe for Utf8Sequence
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>,