doc.rust-lang.org
const MAX_LEN_UTF8: usize
The maximum number of bytes required to encode a char to UTF-8 encoding.
associated_constant
core
Stable since 1.93.0
Version 1.100.0-nightly
doc.rust-lang.org
const MIN: char
The lowest valid code point a char can have, '\0'.
associated_constant
core
Stable since 1.83.0
Version 1.100.0-nightly
doc.rust-lang.org
const REPLACEMENT_CHARACTER: char
U+FFFD REPLACEMENT CHARACTER (�) is used in Unicode to represent a decoding error.
associated_constant
core
Stable since 1.52.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const REPLACEMENT_CHARACTER: char
U+FFFD REPLACEMENT CHARACTER (�) is used in Unicode to represent a decoding error. Use char::REPLACEMENT_CHARACTER instead.
constant
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ToLowercase
Returns an iterator that yields the lowercase equivalent of a char.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ToUppercase
Returns an iterator that yields the uppercase equivalent of a char.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct TryFromCharError
The error type returned when a checked char conversion fails.
struct
core
Stable since 1.59.0
Version 1.100.0-nightly
doc.rust-lang.org
const UNICODE_VERSION: (u8, u8, u8)
The version of Unicode that the Unicode parts of char and str methods are based on.
associated_constant
core
Stable since 1.52.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const UNICODE_VERSION: (u8, u8, u8)
The version of Unicode that the Unicode parts of char and str methods are based on. Use char::UNICODE_VERSION instead.
constant
core
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct CharTryFromError
The error type returned when a conversion from prim@u32 to prim@char fails.
struct
core
Stable since 1.34.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ParseCharError
An error which can be returned when parsing a char.
struct
core
Stable since 1.20.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct DecodeUtf16<I>
An iterator that decodes UTF-16 encoded code points from an iterator of u16s.
struct
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct DecodeUtf16Error
An error that can be returned when decoding UTF-16 code points.
struct
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn unpaired_surrogate(&self) -> u16
Returns the unpaired surrogate which caused this error.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn decode_utf16<I>(iter: I) -> DecodeUtf16<<I as >::IntoIter>
Creates an iterator over the native endian UTF-16 encoded code points in iter, returning unpaired surrogates as Errs.
associated_function
core
Stable since 1.52.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn decode_utf16<I>(iter: I) -> DecodeUtf16<<I as >::IntoIter>
Creates an iterator over the UTF-16 encoded code points in iter, returning unpaired surrogates as Errs. Use char::decode_utf16 instead.
function
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16]
Encodes this character as native endian UTF-16 into the provided u16 buffer, and then returns the subslice of the buffer that contains the encoded character.
method
core
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn encode_utf8(self, dst: &mut [u8]) -> &mut str
Encodes this character as UTF-8 into the provided byte buffer, and then returns the subslice of the buffer that contains the encoded character.
method
core
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn eq_ignore_ascii_case(&self, other: &char) -> bool
Checks that two values are an ASCII case-insensitive match.
method
core
Stable since 1.23.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn escape_debug(self) -> EscapeDebug
Returns an iterator that yields the literal escape code of a character as chars.
method
core
Stable since 1.20.0
Version 1.100.0-nightly