Trait ascii::ToAsciiChar
source · [−]pub trait ToAsciiChar {
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.