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

Convert to AsciiChar.

Errors

If self is outside the valid ascii range, this returns Err

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.

Implementations on Foreign Types

Implementors