pub struct PreparedTwoBytes { /* private fields */ }Expand description
Wrapper for the first two bytes and a precomputed value.
Implementations§
Source§impl PreparedTwoBytes
impl PreparedTwoBytes
Sourcepub const fn new(first: u8, second: u8) -> Self
pub const fn new(first: u8, second: u8) -> Self
Constructor
first and second represent the first two bytes of a
potential UTF-8 sequence for efficient checking for whether
they actually form such a prefix.
Sourcepub const fn sequence_prefix(self) -> bool
pub const fn sequence_prefix(self) -> bool
true iff the two bytes form a prefix of a
well-formed multi-byte UTF-8 sequence.
§Safety-usable invariant
Callers may depend on the above for safety.
Trait Implementations§
Source§impl Clone for PreparedTwoBytes
impl Clone for PreparedTwoBytes
impl Copy for PreparedTwoBytes
Source§impl Debug for PreparedTwoBytes
impl Debug for PreparedTwoBytes
impl Eq for PreparedTwoBytes
Source§impl PartialEq for PreparedTwoBytes
impl PartialEq for PreparedTwoBytes
impl StructuralPartialEq for PreparedTwoBytes
Auto Trait Implementations§
impl Freeze for PreparedTwoBytes
impl RefUnwindSafe for PreparedTwoBytes
impl Send for PreparedTwoBytes
impl Sync for PreparedTwoBytes
impl Unpin for PreparedTwoBytes
impl UnsafeUnpin for PreparedTwoBytes
impl UnwindSafe for PreparedTwoBytes
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
Mutably borrows from an owned value. Read more