#[repr(u8)]pub enum LeadForFourByte {
Bf0 = 240,
Bf1 = 241,
Bf2 = 242,
Bf3 = 243,
Bf4 = 244,
}Expand description
A lead byte for a four-byte UTF-8 sequence (0xF0 to 0xF4, inclusive)
Variants§
Implementations§
Source§impl LeadForFourByte
impl LeadForFourByte
Sourcepub const fn is(byte: u8) -> bool
pub const fn is(byte: u8) -> bool
Whether byte is in range for this type.
§Safety-usable invariant
Iff this method returns true, the safety invariant of new_unchecked()
is satisfied.
Sourcepub const unsafe fn new_unchecked(lead: u8) -> Self
pub const unsafe fn new_unchecked(lead: u8) -> Self
Sourcepub const fn try_new(byte: u8) -> Result<Self, Utf8ByteError>
pub const fn try_new(byte: u8) -> Result<Self, Utf8ByteError>
Fallible constructor
Ok if in the range 0xF0 to 0xF4, inclusive, and Err otherwise.
Sourcepub const fn to_non_ascii(self) -> NonAscii
pub const fn to_non_ascii(self) -> NonAscii
Convert to NonAscii
Sourcepub const fn to_lead_for_multi_byte(self) -> LeadForMultiByte
pub const fn to_lead_for_multi_byte(self) -> LeadForMultiByte
Convert to LeadForMultiByte
Sourcepub const fn low_three(self) -> u8
pub const fn low_three(self) -> u8
Obtain the least-significant three bits (i.e. the non-tag bits).
§Safety-usable invariant
Only the least-significant three bits can have non-zero values.
Sourcepub const fn low_three_u32(self) -> u32
pub const fn low_three_u32(self) -> u32
Obtain the least-significant three bits (i.e. the non-tag bits) as u32.
§Safety-usable invariant
Only the least-significant three bits can have non-zero values.
Trait Implementations§
Source§impl Clone for LeadForFourByte
impl Clone for LeadForFourByte
impl Copy for LeadForFourByte
Source§impl Debug for LeadForFourByte
impl Debug for LeadForFourByte
impl Eq for LeadForFourByte
Source§impl From<LeadForFourByte> for u8
impl From<LeadForFourByte> for u8
Source§fn from(lead: LeadForFourByte) -> Self
fn from(lead: LeadForFourByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForFourByte> for NonAscii
impl From<LeadForFourByte> for NonAscii
Source§fn from(lead: LeadForFourByte) -> Self
fn from(lead: LeadForFourByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForFourByte> for LeadForMultiByte
impl From<LeadForFourByte> for LeadForMultiByte
Source§fn from(lead: LeadForFourByte) -> Self
fn from(lead: LeadForFourByte) -> Self
Converts to this type from the input type.
Source§impl Hash for LeadForFourByte
impl Hash for LeadForFourByte
Source§impl Ord for LeadForFourByte
impl Ord for LeadForFourByte
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for LeadForFourByte
impl PartialEq for LeadForFourByte
Source§impl PartialOrd for LeadForFourByte
impl PartialOrd for LeadForFourByte
impl StructuralPartialEq for LeadForFourByte
Source§impl TryFrom<LeadForMultiByte> for LeadForFourByte
impl TryFrom<LeadForMultiByte> for LeadForFourByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Source§fn try_from(lead: LeadForMultiByte) -> Result<Self, Utf8ByteError>
fn try_from(lead: LeadForMultiByte) -> Result<Self, Utf8ByteError>
Performs the conversion.
Source§impl TryFrom<NonAscii> for LeadForFourByte
impl TryFrom<NonAscii> for LeadForFourByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Source§impl TryFrom<u8> for LeadForFourByte
impl TryFrom<u8> for LeadForFourByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for LeadForFourByte
impl RefUnwindSafe for LeadForFourByte
impl Send for LeadForFourByte
impl Sync for LeadForFourByte
impl Unpin for LeadForFourByte
impl UnsafeUnpin for LeadForFourByte
impl UnwindSafe for LeadForFourByte
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