pub struct Lat1StrF<const N: usize> { /* private fields */ }
Expand description
Latin-1 (aka. ISO 8859-1) of fixed size
Implementations§
Methods from Deref<Target = Lat1Str>§
Sourcepub fn try_as_ascii(&self) -> Result<&str, Lat1Error>
pub fn try_as_ascii(&self) -> Result<&str, Lat1Error>
Returns the string in UTF-8 encoding, only if the string is pure ASCII.
Otherwise, a Lat1Error::NonAscii
is returned.
Sourcepub fn as_ascii(&self) -> &str
pub fn as_ascii(&self) -> &str
Returns the string in UTF-8 encoding, only if the string is pure ASCII.
§Panics
This function panics if the string contains non-ASCII chars.
Sourcepub unsafe fn as_ascii_unchecked(&self) -> &str
pub unsafe fn as_ascii_unchecked(&self) -> &str
Returns the string in UTF-8 encoding.
§Safety
If the string contains non-ASCII characters, the returned string will be invalid UTF-8.
Trait Implementations§
impl<const N: usize> Copy for Lat1StrF<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for Lat1StrF<N>
impl<const N: usize> RefUnwindSafe for Lat1StrF<N>
impl<const N: usize> Send for Lat1StrF<N>
impl<const N: usize> Sync for Lat1StrF<N>
impl<const N: usize> Unpin for Lat1StrF<N>
impl<const N: usize> UnwindSafe for Lat1StrF<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)