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§
Sourceunsafe fn into_ascii_string_unchecked(self) -> AsciiString
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
Convert to AsciiString
without checking for non-ASCII characters.
Sourcefn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
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.
impl IntoAsciiString for CString
Note that the trailing null byte will be removed in the conversion.
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
Source§impl IntoAsciiString for String
impl IntoAsciiString for String
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
Source§impl IntoAsciiString for Vec<AsciiChar>
impl IntoAsciiString for Vec<AsciiChar>
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
Source§impl IntoAsciiString for Vec<u8>
impl IntoAsciiString for Vec<u8>
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
Source§impl<'a> IntoAsciiString for &'a str
impl<'a> IntoAsciiString for &'a str
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
Source§impl<'a> IntoAsciiString for &'a CStr
Note that the trailing null byte will be removed in the conversion.
impl<'a> IntoAsciiString for &'a CStr
Note that the trailing null byte will be removed in the conversion.