pub struct AsAsciiStrError(/* private fields */);
Expand description
Error that is returned when a sequence of u8
are not all ASCII.
Is used by As[Mut]AsciiStr
and the from_ascii
method on AsciiStr
and AsciiString
.
Implementations§
Source§impl AsAsciiStrError
impl AsAsciiStrError
Sourcepub fn valid_up_to(self) -> usize
pub fn valid_up_to(self) -> usize
Returns the index of the first non-ASCII byte.
It is the maximum index such that from_ascii(input[..index])
would return Ok(_)
.
Trait Implementations§
Source§impl Clone for AsAsciiStrError
impl Clone for AsAsciiStrError
Source§fn clone(&self) -> AsAsciiStrError
fn clone(&self) -> AsAsciiStrError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AsAsciiStrError
impl Debug for AsAsciiStrError
Source§impl Display for AsAsciiStrError
impl Display for AsAsciiStrError
Source§impl Error for AsAsciiStrError
impl Error for AsAsciiStrError
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
Source§impl PartialEq for AsAsciiStrError
impl PartialEq for AsAsciiStrError
impl Copy for AsAsciiStrError
impl Eq for AsAsciiStrError
impl StructuralPartialEq for AsAsciiStrError
Auto Trait Implementations§
impl Freeze for AsAsciiStrError
impl RefUnwindSafe for AsAsciiStrError
impl Send for AsAsciiStrError
impl Sync for AsAsciiStrError
impl Unpin for AsAsciiStrError
impl UnwindSafe for AsAsciiStrError
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