pub struct InvalidRadixError { /* private fields */ }
Expand description
Error that indicates the radix input to parse
was invalid.
This error can be returned in the following circumstances:
- The input is out of range of
i32
. - The input radix is negative (if the input byte string does not have an
0x
-style prefix) and out of range-36..=-2
. - The input is out of range of
2..=36
.
This error may map to several Ruby Exception
types. See
InvalidRadixExceptionKind
for more details.
§Examples
let result = scolapasta_int_parse::parse("123", Some(500));
let err = result.unwrap_err();
assert_eq!(err.to_string(), "invalid radix 500");
Implementations§
Source§impl InvalidRadixError
impl InvalidRadixError
Sourcepub fn exception_kind(&self) -> InvalidRadixExceptionKind
pub fn exception_kind(&self) -> InvalidRadixExceptionKind
Map an invalid radix error to the kind of Ruby Exception
it should be
raised as.
See InvalidRadixExceptionKind
for more details.
Trait Implementations§
Source§impl Clone for InvalidRadixError
impl Clone for InvalidRadixError
Source§fn clone(&self) -> InvalidRadixError
fn clone(&self) -> InvalidRadixError
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 InvalidRadixError
impl Debug for InvalidRadixError
Source§impl Display for InvalidRadixError
impl Display for InvalidRadixError
Source§impl Error for InvalidRadixError
impl Error for InvalidRadixError
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<InvalidRadixError> for Error<'a>
impl<'a> From<InvalidRadixError> for Error<'a>
Source§fn from(err: InvalidRadixError) -> Self
fn from(err: InvalidRadixError) -> Self
Converts to this type from the input type.
Source§impl Hash for InvalidRadixError
impl Hash for InvalidRadixError
Source§impl Ord for InvalidRadixError
impl Ord for InvalidRadixError
Source§fn cmp(&self, other: &InvalidRadixError) -> Ordering
fn cmp(&self, other: &InvalidRadixError) -> 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 PartialEq for InvalidRadixError
impl PartialEq for InvalidRadixError
Source§impl PartialOrd for InvalidRadixError
impl PartialOrd for InvalidRadixError
impl Copy for InvalidRadixError
impl Eq for InvalidRadixError
impl StructuralPartialEq for InvalidRadixError
Auto Trait Implementations§
impl Freeze for InvalidRadixError
impl RefUnwindSafe for InvalidRadixError
impl Send for InvalidRadixError
impl Sync for InvalidRadixError
impl Unpin for InvalidRadixError
impl UnwindSafe for InvalidRadixError
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