Struct scolapasta_int_parse::ArgumentError
source · pub struct ArgumentError<'a> { /* private fields */ }
Expand description
Error that indicates the byte string input to parse
was invalid.
This error can be returned in the following circumstances:
- The input has non-ASCII bytes.
- The input contains a NUL byte.
- The input is the empty byte slice.
- The input only contains +/- signs.
- The given radix does not match a
0x
-style prefix. - Invalid or duplicate +/- signs are in the input.
- Consecutive underscores are present in the input.
- Leading or trailing underscores are present in the input.
- The input contains ASCII alphanumeric bytes that are invalid for the computed radix.
§Examples
let result = scolapasta_int_parse::parse("0xBAD", Some(10));
let err = result.unwrap_err();
assert_eq!(err.to_string(), r#"invalid value for Integer(): "0xBAD""#);
Implementations§
source§impl<'a> ArgumentError<'a>
impl<'a> ArgumentError<'a>
Trait Implementations§
source§impl<'a> Clone for ArgumentError<'a>
impl<'a> Clone for ArgumentError<'a>
source§fn clone(&self) -> ArgumentError<'a>
fn clone(&self) -> ArgumentError<'a>
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<'a> Debug for ArgumentError<'a>
impl<'a> Debug for ArgumentError<'a>
source§impl<'a> Default for ArgumentError<'a>
impl<'a> Default for ArgumentError<'a>
source§fn default() -> ArgumentError<'a>
fn default() -> ArgumentError<'a>
Returns the “default value” for a type. Read more
source§impl<'a> Display for ArgumentError<'a>
impl<'a> Display for ArgumentError<'a>
source§impl<'a> Error for ArgumentError<'a>
impl<'a> Error for ArgumentError<'a>
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
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<'a> From<&'a [u8]> for ArgumentError<'a>
impl<'a> From<&'a [u8]> for ArgumentError<'a>
source§impl<'a> From<ArgumentError<'a>> for Error<'a>
impl<'a> From<ArgumentError<'a>> for Error<'a>
source§fn from(err: ArgumentError<'a>) -> Self
fn from(err: ArgumentError<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Hash for ArgumentError<'a>
impl<'a> Hash for ArgumentError<'a>
source§impl<'a> Ord for ArgumentError<'a>
impl<'a> Ord for ArgumentError<'a>
source§fn cmp(&self, other: &ArgumentError<'a>) -> Ordering
fn cmp(&self, other: &ArgumentError<'a>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq for ArgumentError<'a>
impl<'a> PartialEq for ArgumentError<'a>
source§fn eq(&self, other: &ArgumentError<'a>) -> bool
fn eq(&self, other: &ArgumentError<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialOrd for ArgumentError<'a>
impl<'a> PartialOrd for ArgumentError<'a>
source§fn partial_cmp(&self, other: &ArgumentError<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArgumentError<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Copy for ArgumentError<'a>
impl<'a> Eq for ArgumentError<'a>
impl<'a> StructuralPartialEq for ArgumentError<'a>
Auto Trait Implementations§
impl<'a> Freeze for ArgumentError<'a>
impl<'a> RefUnwindSafe for ArgumentError<'a>
impl<'a> Send for ArgumentError<'a>
impl<'a> Sync for ArgumentError<'a>
impl<'a> Unpin for ArgumentError<'a>
impl<'a> UnwindSafe for ArgumentError<'a>
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