Trait ascii::AsMutAsciiStr
source · [−]pub trait AsMutAsciiStr: AsAsciiStr {
fn slice_ascii_mut<R>(
&mut self,
range: R
) -> Result<&mut AsciiStr, AsAsciiStrError>
where
R: SliceIndex<[Self::Inner], Output = [Self::Inner]>;
unsafe fn as_mut_ascii_str_unchecked(&mut self) -> &mut AsciiStr;
fn as_mut_ascii_str(&mut self) -> Result<&mut AsciiStr, AsAsciiStrError> { ... }
}
Required Methods
sourcefn slice_ascii_mut<R>(
&mut self,
range: R
) -> Result<&mut AsciiStr, AsAsciiStrError>where
R: SliceIndex<[Self::Inner], Output = [Self::Inner]>,
fn slice_ascii_mut<R>(
&mut self,
range: R
) -> Result<&mut AsciiStr, AsAsciiStrError>where
R: SliceIndex<[Self::Inner], Output = [Self::Inner]>,
Convert a subslice to an ASCII slice.
Errors
This function returns Err
if range is out of bounds, or if
self
contains non-ascii values
sourceunsafe fn as_mut_ascii_str_unchecked(&mut self) -> &mut AsciiStr
unsafe fn as_mut_ascii_str_unchecked(&mut self) -> &mut AsciiStr
Convert to a mutable ASCII slice without checking for non-ASCII characters.
Safety
Calling this function when self
contains non-ascii characters is
undefined behavior.
Provided Methods
sourcefn as_mut_ascii_str(&mut self) -> Result<&mut AsciiStr, AsAsciiStrError>
fn as_mut_ascii_str(&mut self) -> Result<&mut AsciiStr, AsAsciiStrError>
Convert to a mutable ASCII slice.
Errors
This function returns Err
if self
contains non-ascii values