pub struct PreparedThreeBytes { /* private fields */ }Expand description
Wrapper for the first three bytes and a precomputed value.
Implementations§
Source§impl PreparedThreeBytes
impl PreparedThreeBytes
Sourcepub const fn new(first: u8, second: u8, third: u8) -> Self
pub const fn new(first: u8, second: u8, third: u8) -> Self
Constructor
first, second, and third represent the first three bytes of a
potential UTF-8 sequence for efficient checking for whether
they actually form a prefix of a well-formed UTF-8 sequence.
Sourcepub const fn new_with_prepared(prepared: PreparedTwoBytes, third: u8) -> Self
pub const fn new_with_prepared(prepared: PreparedTwoBytes, third: u8) -> Self
Constructor with already-prepared first two bytes
prepared and third represent the first three bytes of a
potential UTF-8 sequence for efficient checking for whether
they actually form a prefix of a well-formed UTF-8 sequence.
Sourcepub const fn prefix_of_four_byte(self) -> bool
pub const fn prefix_of_four_byte(self) -> bool
Return true iff these three bytes represent a three-byte
prefix of a well-formed four-byte UTF-8 sequence.
§Safety-usable invariant
The caller may rely on the result for safety.
Trait Implementations§
Source§impl Clone for PreparedThreeBytes
impl Clone for PreparedThreeBytes
impl Copy for PreparedThreeBytes
Source§impl Debug for PreparedThreeBytes
impl Debug for PreparedThreeBytes
impl Eq for PreparedThreeBytes
Source§impl PartialEq for PreparedThreeBytes
impl PartialEq for PreparedThreeBytes
impl StructuralPartialEq for PreparedThreeBytes
Auto Trait Implementations§
impl Freeze for PreparedThreeBytes
impl RefUnwindSafe for PreparedThreeBytes
impl Send for PreparedThreeBytes
impl Sync for PreparedThreeBytes
impl Unpin for PreparedThreeBytes
impl UnsafeUnpin for PreparedThreeBytes
impl UnwindSafe for PreparedThreeBytes
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