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 as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns the string as slice of bytes.
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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more