pub trait ToAsciiChar {
// Required methods
fn to_ascii_char(self) -> Result<AsciiChar, ToAsciiCharError>;
unsafe fn to_ascii_char_unchecked(self) -> AsciiChar;
}Expand description
Convert char, u8 and other character types to AsciiChar.
Required Methods§
Sourcefn to_ascii_char(self) -> Result<AsciiChar, ToAsciiCharError>
fn to_ascii_char(self) -> Result<AsciiChar, ToAsciiCharError>
Sourceunsafe fn to_ascii_char_unchecked(self) -> AsciiChar
unsafe fn to_ascii_char_unchecked(self) -> AsciiChar
Convert to AsciiChar without checking that it is an ASCII character.
§Safety
Calling this function with a value outside of the ascii range, 0x0 to 0x7f inclusive,
is undefined behavior.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".