ascii

Trait IntoAsciiString

Source
pub trait IntoAsciiString: Sized {
    // Required methods
    unsafe fn into_ascii_string_unchecked(self) -> AsciiString;
    fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>;
}
Expand description

Convert vectors into AsciiString.

Required Methods§

Source

unsafe fn into_ascii_string_unchecked(self) -> AsciiString

Convert to AsciiString without checking for non-ASCII characters.

Source

fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>

Convert to AsciiString.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoAsciiString for CString

Note that the trailing null byte will be removed in the conversion.

Source§

impl IntoAsciiString for String

Source§

impl IntoAsciiString for Vec<AsciiChar>

Source§

impl IntoAsciiString for Vec<u8>

Source§

impl<'a> IntoAsciiString for &'a str

Source§

impl<'a> IntoAsciiString for &'a CStr

Note that the trailing null byte will be removed in the conversion.

Source§

impl<'a> IntoAsciiString for &'a [AsciiChar]

Source§

impl<'a> IntoAsciiString for &'a [u8]

Source§

impl<'a, B> IntoAsciiString for Cow<'a, B>

Implementors§