Struct ascii::AsAsciiStrError
source · [−]pub struct AsAsciiStrError(_);
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
sourceimpl AsAsciiStrError
impl AsAsciiStrError
sourcepub const fn valid_up_to(self) -> usize
pub const 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
sourceimpl Clone for AsAsciiStrError
impl Clone for AsAsciiStrError
sourcefn clone(&self) -> AsAsciiStrError
fn clone(&self) -> AsAsciiStrError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for AsAsciiStrError
impl Debug for AsAsciiStrError
sourceimpl Display for AsAsciiStrError
impl Display for AsAsciiStrError
sourceimpl Error for AsAsciiStrError
impl Error for AsAsciiStrError
sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourceimpl PartialEq<AsAsciiStrError> for AsAsciiStrError
impl PartialEq<AsAsciiStrError> for AsAsciiStrError
sourcefn eq(&self, other: &AsAsciiStrError) -> bool
fn eq(&self, other: &AsAsciiStrError) -> bool
impl Copy for AsAsciiStrError
impl Eq for AsAsciiStrError
impl StructuralEq for AsAsciiStrError
impl StructuralPartialEq for AsAsciiStrError
Auto Trait Implementations
impl RefUnwindSafe for AsAsciiStrError
impl Send for AsAsciiStrError
impl Sync for AsAsciiStrError
impl Unpin for AsAsciiStrError
impl UnwindSafe for AsAsciiStrError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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