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§
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)>
The lower-level source of this error, if any. Read more
source§impl PartialEq<AsAsciiStrError> for AsAsciiStrError
impl PartialEq<AsAsciiStrError> for AsAsciiStrError
source§fn eq(&self, other: &AsAsciiStrError) -> bool
fn eq(&self, other: &AsAsciiStrError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.