pub struct OutOfRangeError { /* private fields */ }
Expand description
Error returned when a parsed amount is too big or too small.
Implementations§
source§impl OutOfRangeError
impl OutOfRangeError
sourcepub fn valid_range(&self) -> (i64, u64)
pub fn valid_range(&self) -> (i64, u64)
Returns the minimum and maximum allowed values for the type that was parsed.
This can be used to give a hint to the user which values are allowed.
sourcepub fn is_above_max(&self) -> bool
pub fn is_above_max(&self) -> bool
Returns true if the input value was large than the maximum allowed value.
sourcepub fn is_below_min(&self) -> bool
pub fn is_below_min(&self) -> bool
Returns true if the input value was smaller than the minimum allowed value.
Trait Implementations§
source§impl Clone for OutOfRangeError
impl Clone for OutOfRangeError
source§fn clone(&self) -> OutOfRangeError
fn clone(&self) -> OutOfRangeError
Returns a copy of the value. Read more
1.6.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 OutOfRangeError
impl Debug for OutOfRangeError
source§impl Display for OutOfRangeError
impl Display for OutOfRangeError
source§impl Error for OutOfRangeError
Available on crate feature std
only.
impl Error for OutOfRangeError
Available on crate feature
std
only.1.81.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.81.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<OutOfRangeError> for ParseAmountError
impl From<OutOfRangeError> for ParseAmountError
source§fn from(value: OutOfRangeError) -> Self
fn from(value: OutOfRangeError) -> Self
Converts to this type from the input type.
source§impl From<OutOfRangeError> for ParseError
impl From<OutOfRangeError> for ParseError
source§fn from(e: OutOfRangeError) -> Self
fn from(e: OutOfRangeError) -> Self
Converts to this type from the input type.
source§impl PartialEq for OutOfRangeError
impl PartialEq for OutOfRangeError
impl Copy for OutOfRangeError
impl Eq for OutOfRangeError
impl StructuralPartialEq for OutOfRangeError
Auto Trait Implementations§
impl Freeze for OutOfRangeError
impl RefUnwindSafe for OutOfRangeError
impl Send for OutOfRangeError
impl Sync for OutOfRangeError
impl Unpin for OutOfRangeError
impl UnwindSafe for OutOfRangeError
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)