#[repr(u8)]pub enum LeadForThreeByte {
Show 16 variants
Be0 = 224,
Be1 = 225,
Be2 = 226,
Be3 = 227,
Be4 = 228,
Be5 = 229,
Be6 = 230,
Be7 = 231,
Be8 = 232,
Be9 = 233,
Bea = 234,
Beb = 235,
Bec = 236,
Bed = 237,
Bee = 238,
Bef = 239,
}Expand description
A lead byte for a three-byte UTF-8 sequence (0xE0 to 0xEF, inclusive)
Variants§
Be0 = 224
Be1 = 225
Be2 = 226
Be3 = 227
Be4 = 228
Be5 = 229
Be6 = 230
Be7 = 231
Be8 = 232
Be9 = 233
Bea = 234
Beb = 235
Bec = 236
Bed = 237
Bee = 238
Bef = 239
Implementations§
Source§impl LeadForThreeByte
impl LeadForThreeByte
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 0xE0 to 0xEF, 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_four(self) -> u8
pub const fn low_four(self) -> u8
Obtain the least-significant four bits (i.e. the non-tag bits).
§Safety-usable invariant
Only the least-significant four bits can have non-zero values.
Sourcepub const fn low_four_u32(self) -> u32
pub const fn low_four_u32(self) -> u32
Obtain the least-significant four bits (i.e. the non-tag bits) as u32.
§Safety-usable invariant
Only the least-significant four bits can have non-zero values.
Trait Implementations§
Source§impl Clone for LeadForThreeByte
impl Clone for LeadForThreeByte
impl Copy for LeadForThreeByte
Source§impl Debug for LeadForThreeByte
impl Debug for LeadForThreeByte
impl Eq for LeadForThreeByte
Source§impl From<LeadForThreeByte> for u8
impl From<LeadForThreeByte> for u8
Source§fn from(lead: LeadForThreeByte) -> Self
fn from(lead: LeadForThreeByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForThreeByte> for NonAscii
impl From<LeadForThreeByte> for NonAscii
Source§fn from(lead: LeadForThreeByte) -> Self
fn from(lead: LeadForThreeByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForThreeByte> for LeadForMultiByte
impl From<LeadForThreeByte> for LeadForMultiByte
Source§fn from(lead: LeadForThreeByte) -> Self
fn from(lead: LeadForThreeByte) -> Self
Converts to this type from the input type.
Source§impl Hash for LeadForThreeByte
impl Hash for LeadForThreeByte
Source§impl Ord for LeadForThreeByte
impl Ord for LeadForThreeByte
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 LeadForThreeByte
impl PartialEq for LeadForThreeByte
Source§impl PartialOrd for LeadForThreeByte
impl PartialOrd for LeadForThreeByte
impl StructuralPartialEq for LeadForThreeByte
Source§impl TryFrom<LeadForMultiByte> for LeadForThreeByte
impl TryFrom<LeadForMultiByte> for LeadForThreeByte
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 LeadForThreeByte
impl TryFrom<NonAscii> for LeadForThreeByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Source§impl TryFrom<u8> for LeadForThreeByte
impl TryFrom<u8> for LeadForThreeByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for LeadForThreeByte
impl RefUnwindSafe for LeadForThreeByte
impl Send for LeadForThreeByte
impl Sync for LeadForThreeByte
impl Unpin for LeadForThreeByte
impl UnsafeUnpin for LeadForThreeByte
impl UnwindSafe for LeadForThreeByte
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