#[repr(transparent)]pub struct Char32(pub char);Expand description
Tuple Fields§
§0: charImplementations§
Source§impl Char32
impl Char32
Source§impl Char32
impl Char32
Sourcepub const REPLACEMENT_CHARACTER: Char32
pub const REPLACEMENT_CHARACTER: Char32
U+FFFD REPLACEMENT CHARACTER (�) is used in Unicode to represent a decoding error.
Sourcepub const fn from_char7(c: Char7) -> Char32
pub const fn from_char7(c: Char7) -> Char32
Converts a Char7 to Char32.
Sourcepub const fn from_char8(c: Char8) -> Char32
pub const fn from_char8(c: Char8) -> Char32
Converts a Char8 to Char32.
Sourcepub const fn from_char16(c: Char16) -> Char32
pub const fn from_char16(c: Char16) -> Char32
Converts a Char16 to Char32.
Sourcepub const fn from_char24(c: Char24) -> Char32
pub const fn from_char24(c: Char24) -> Char32
Converts a Char24 to Char32.
Sourcepub const fn try_to_char7(self) -> Result<Char7>
pub const fn try_to_char7(self) -> Result<Char7>
Tries to convert this Char32 to Char7.
Sourcepub const fn try_to_char8(self) -> Result<Char8>
pub const fn try_to_char8(self) -> Result<Char8>
Tries to convert this Char32 to Char8.
Sourcepub const fn try_to_char16(self) -> Result<Char16>
pub const fn try_to_char16(self) -> Result<Char16>
Tries to convert this Char32 to Char16.
Sourcepub const fn to_utf8_bytes(self) -> [u8; 4]
pub const fn to_utf8_bytes(self) -> [u8; 4]
Converts this Char32 to an UTF-8 encoded sequence of bytes.
Note that this function always returns a 4-byte array, but the actual UTF-8 sequence may be shorter. The unused bytes are set to 0.
Sourcepub const fn to_ascii_uppercase(self) -> Char32
pub const fn to_ascii_uppercase(self) -> Char32
Makes a copy of the value in its ASCII upper case equivalent.
ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.
Sourcepub const fn to_ascii_lowercase(self) -> Char32
pub const fn to_ascii_lowercase(self) -> Char32
Makes a copy of the value in its ASCII lower case equivalent.
ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.
Sourcepub const fn is_noncharacter(self) -> bool
pub const fn is_noncharacter(self) -> bool
Returns true if this unicode scalar is a noncharacter.
Sourcepub const fn is_character(self) -> bool
pub const fn is_character(self) -> bool
Returns true if this unicode scalar is an abstract character.
Trait Implementations§
Source§impl Chars for Char32
impl Chars for Char32
Source§fn encode_utf8(self, dst: &mut [u8]) -> &mut str
fn encode_utf8(self, dst: &mut [u8]) -> &mut str
Source§fn to_utf8_bytes(self) -> [u8; 4]
fn to_utf8_bytes(self) -> [u8; 4]
scalar to an UTF-8 encoded sequence of bytes. Read moreSource§fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]
fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]
Source§fn to_digit(self, radix: u32) -> Option<u32>
fn to_digit(self, radix: u32) -> Option<u32>
Source§fn to_ascii_uppercase(self) -> Self
fn to_ascii_uppercase(self) -> Self
Source§fn to_ascii_lowercase(self) -> Self
fn to_ascii_lowercase(self) -> Self
Source§fn is_noncharacter(self) -> bool
fn is_noncharacter(self) -> bool
true if this unicode scalar is a noncharacter.Source§fn is_digit(self, radix: u32) -> bool
fn is_digit(self, radix: u32) -> bool
Source§fn is_control(self) -> bool
fn is_control(self) -> bool
true if this unicode scalar has the general category for
control codes.Source§fn is_alphabetic(self) -> bool
fn is_alphabetic(self) -> bool
true if this unicode scalar has the Alphabetic property.Source§fn is_numeric(self) -> bool
fn is_numeric(self) -> bool
true if this unicode scalar has one of the general categories
for numbers. Read moreSource§fn is_alphanumeric(self) -> bool
fn is_alphanumeric(self) -> bool
Source§fn is_lowercase(self) -> bool
fn is_lowercase(self) -> bool
true if this unicode scalar has the Lowercase property.Source§fn is_uppercase(self) -> bool
fn is_uppercase(self) -> bool
true if this unicode scalar has the Lowercase property.Source§fn is_whitespace(self) -> bool
fn is_whitespace(self) -> bool
true if this unicode scalar has the White_Space property.Source§fn is_character(self) -> boolwhere
Self: Sized,
fn is_character(self) -> boolwhere
Self: Sized,
true if this unicode scalar is an abstract character.