Struct markup5ever::SmallCharSet [−][src]
pub struct SmallCharSet { pub bits: u64, }
Represents a set of “small characters”, those with Unicode scalar values less than 64.
This is stored as a bitmap, with 1 bit for each value.
Fields
bits: u64
Implementations
impl SmallCharSet
[src]
pub fn nonmember_prefix_len(&self, buf: &str) -> u32
[src]
Count the number of bytes of characters at the beginning of buf
which are not in the set.
This functionality is used in BufferQueue::pop_except_from
.
Examples
let set = small_char_set!(48 49 50); // '0' '1' '2' // `test` is 4 chars, 😁 is 4 chars, then we meet a character in the set let test_str = "test😁01232afd"; assert_eq!(set.nonmember_prefix_len(test_str), 8);
Trait Implementations
impl Clone for SmallCharSet
[src]
fn clone(&self) -> SmallCharSet
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SmallCharSet
[src]
impl Debug for SmallCharSet
[src]
impl Eq for SmallCharSet
[src]
impl Hash for SmallCharSet
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SmallCharSet> for SmallCharSet
[src]
fn eq(&self, other: &SmallCharSet) -> bool
[src]
fn ne(&self, other: &SmallCharSet) -> bool
[src]
impl StructuralEq for SmallCharSet
[src]
impl StructuralPartialEq for SmallCharSet
[src]
Auto Trait Implementations
impl RefUnwindSafe for SmallCharSet
impl Send for SmallCharSet
impl Sync for SmallCharSet
impl Unpin for SmallCharSet
impl UnwindSafe for SmallCharSet
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,