Trait ascii::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§
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
.
Implementations on Foreign Types§
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<'a> IntoAsciiString for &'a [u8]
impl<'a> IntoAsciiString for &'a [u8]
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
source§impl<'a> IntoAsciiString for &'a CStr
impl<'a> IntoAsciiString for &'a CStr
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<'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 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 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<'a, B> IntoAsciiString for Cow<'a, B>where
B: 'a + ToOwned + ?Sized,
&'a B: IntoAsciiString,
<B as ToOwned>::Owned: IntoAsciiString,
impl<'a, B> IntoAsciiString for Cow<'a, B>where B: 'a + ToOwned + ?Sized, &'a B: IntoAsciiString, <B as ToOwned>::Owned: IntoAsciiString,
unsafe fn into_ascii_string_unchecked(self) -> AsciiString
fn into_ascii_string(self) -> Result<AsciiString, FromAsciiError<Self>>
source§impl IntoAsciiString for CString
impl IntoAsciiString for CString
Note that the trailing null byte will be removed in the conversion.