Enum utf8_ranges::Utf8Sequence [−][src]
pub enum Utf8Sequence {
One(Utf8Range),
Two([Utf8Range; 2]),
Three([Utf8Range; 3]),
Four([Utf8Range; 4]),
}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]
impl Utf8Sequencepub fn as_slice(&self) -> &[Utf8Range][src]
pub fn as_slice(&self) -> &[Utf8Range]Returns the underlying sequence of byte ranges as a slice.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns 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]
pub fn matches(&self, bytes: &[u8]) -> boolReturns true if and only if a prefix of bytes matches this sequence
of byte ranges.
Trait Implementations
impl Copy for Utf8Sequence[src]
impl Copy for Utf8Sequenceimpl Clone for Utf8Sequence[src]
impl Clone for Utf8Sequencefn clone(&self) -> Utf8Sequence[src]
fn clone(&self) -> Utf8SequenceReturns 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 Eq for Utf8Sequence[src]
impl Eq for Utf8Sequenceimpl PartialEq for Utf8Sequence[src]
impl PartialEq for Utf8Sequencefn eq(&self, other: &Utf8Sequence) -> bool[src]
fn eq(&self, other: &Utf8Sequence) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Utf8Sequence) -> bool[src]
fn ne(&self, other: &Utf8Sequence) -> boolThis method tests for !=.
impl<'a> IntoIterator for &'a Utf8Sequence[src]
impl<'a> IntoIterator for &'a Utf8Sequencetype 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]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl Debug for Utf8Sequence[src]
impl Debug for Utf8SequenceAuto Trait Implementations
impl Send for Utf8Sequence
impl Send for Utf8Sequenceimpl Sync for Utf8Sequence
impl Sync for Utf8Sequence