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)>
Returns 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§impl<'a> PartialOrd for ArgumentError<'a>
impl<'a> PartialOrd for ArgumentError<'a>
impl<'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