#[repr(u8)]pub enum LeadForTwoByte {
Show 30 variants
Bc2 = 194,
Bc3 = 195,
Bc4 = 196,
Bc5 = 197,
Bc6 = 198,
Bc7 = 199,
Bc8 = 200,
Bc9 = 201,
Bca = 202,
Bcb = 203,
Bcc = 204,
Bcd = 205,
Bce = 206,
Bcf = 207,
Bd0 = 208,
Bd1 = 209,
Bd2 = 210,
Bd3 = 211,
Bd4 = 212,
Bd5 = 213,
Bd6 = 214,
Bd7 = 215,
Bd8 = 216,
Bd9 = 217,
Bda = 218,
Bdb = 219,
Bdc = 220,
Bdd = 221,
Bde = 222,
Bdf = 223,
}Expand description
A lead byte for a two-byte UTF-8 sequence (0xC2 to 0xDF, inclusive)
Variants§
Bc2 = 194
Bc3 = 195
Bc4 = 196
Bc5 = 197
Bc6 = 198
Bc7 = 199
Bc8 = 200
Bc9 = 201
Bca = 202
Bcb = 203
Bcc = 204
Bcd = 205
Bce = 206
Bcf = 207
Bd0 = 208
Bd1 = 209
Bd2 = 210
Bd3 = 211
Bd4 = 212
Bd5 = 213
Bd6 = 214
Bd7 = 215
Bd8 = 216
Bd9 = 217
Bda = 218
Bdb = 219
Bdc = 220
Bdd = 221
Bde = 222
Bdf = 223
Implementations§
Source§impl LeadForTwoByte
impl LeadForTwoByte
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 0xC2 to 0xDF, 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_five(self) -> u8
pub const fn low_five(self) -> u8
Obtain the least-significant five bits (i.e. the non-tag bits).
§Safety-usable invariant
Only the least-significant five bits can have non-zero values.
Sourcepub const fn low_five_u32(self) -> u32
pub const fn low_five_u32(self) -> u32
Obtain the least-significant five bits (i.e. the non-tag bits) as u32.
§Safety-usable invariant
Only the least-significant five bits can have non-zero values.
Trait Implementations§
Source§impl Clone for LeadForTwoByte
impl Clone for LeadForTwoByte
impl Copy for LeadForTwoByte
Source§impl Debug for LeadForTwoByte
impl Debug for LeadForTwoByte
impl Eq for LeadForTwoByte
Source§impl From<LeadForTwoByte> for u8
impl From<LeadForTwoByte> for u8
Source§fn from(lead: LeadForTwoByte) -> Self
fn from(lead: LeadForTwoByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForTwoByte> for NonAscii
impl From<LeadForTwoByte> for NonAscii
Source§fn from(lead: LeadForTwoByte) -> Self
fn from(lead: LeadForTwoByte) -> Self
Converts to this type from the input type.
Source§impl From<LeadForTwoByte> for LeadForMultiByte
impl From<LeadForTwoByte> for LeadForMultiByte
Source§fn from(lead: LeadForTwoByte) -> Self
fn from(lead: LeadForTwoByte) -> Self
Converts to this type from the input type.
Source§impl Hash for LeadForTwoByte
impl Hash for LeadForTwoByte
Source§impl Ord for LeadForTwoByte
impl Ord for LeadForTwoByte
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 LeadForTwoByte
impl PartialEq for LeadForTwoByte
Source§impl PartialOrd for LeadForTwoByte
impl PartialOrd for LeadForTwoByte
impl StructuralPartialEq for LeadForTwoByte
Source§impl TryFrom<LeadForMultiByte> for LeadForTwoByte
impl TryFrom<LeadForMultiByte> for LeadForTwoByte
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 LeadForTwoByte
impl TryFrom<NonAscii> for LeadForTwoByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Source§impl TryFrom<u8> for LeadForTwoByte
impl TryFrom<u8> for LeadForTwoByte
Source§type Error = Utf8ByteError
type Error = Utf8ByteError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for LeadForTwoByte
impl RefUnwindSafe for LeadForTwoByte
impl Send for LeadForTwoByte
impl Sync for LeadForTwoByte
impl Unpin for LeadForTwoByte
impl UnsafeUnpin for LeadForTwoByte
impl UnwindSafe for LeadForTwoByte
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