[−][src]Enum utf8_ranges::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([Utf8Range; 2])
Two successive byte ranges.
Three([Utf8Range; 3])
Three successive byte ranges.
Four([Utf8Range; 4])
Four successive byte ranges.
Methods
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 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 PartialEq<Utf8Sequence> for Utf8Sequence
[src][+]
impl<'a> IntoIterator for &'a Utf8Sequence
[src][+]
impl Clone for Utf8Sequence
[src][+]
impl Eq for Utf8Sequence
[src]
impl Copy for Utf8Sequence
[src]
impl Debug for Utf8Sequence
[src][+]
Auto Trait Implementations
impl Send for Utf8Sequence
impl Sync for Utf8Sequence
Blanket Implementations
impl<T> From for T
[src][−]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][−]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src][−]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,