pub struct OutOfRangeNumericError { /* private fields */ }Expand description
Error returned when a numeric newtype is outside its range bounds.
Implementations§
Source§impl OutOfRangeNumericError
impl OutOfRangeNumericError
Sourcepub const fn new(actual: NumericValue) -> Self
pub const fn new(actual: NumericValue) -> Self
Creates an out-of-range error with the value that failed validation.
Sourcepub const fn with_lower_bound(self, lower_bound: NumericValue) -> Self
pub const fn with_lower_bound(self, lower_bound: NumericValue) -> Self
Returns an out-of-range error with the lower bound that failed.
Sourcepub const fn with_upper_bound(self, upper_bound: NumericValue) -> Self
pub const fn with_upper_bound(self, upper_bound: NumericValue) -> Self
Returns an out-of-range error with the upper bound that failed.
Sourcepub const fn actual(&self) -> NumericValue
pub const fn actual(&self) -> NumericValue
Returns the actual value that failed validation.
Sourcepub const fn lower_bound(&self) -> Option<NumericValue>
pub const fn lower_bound(&self) -> Option<NumericValue>
Returns the lower bound that failed when it could be captured losslessly.
Sourcepub const fn upper_bound(&self) -> Option<NumericValue>
pub const fn upper_bound(&self) -> Option<NumericValue>
Returns the upper bound that failed when it could be captured losslessly.
Trait Implementations§
Source§impl Clone for OutOfRangeNumericError
impl Clone for OutOfRangeNumericError
Source§fn clone(&self) -> OutOfRangeNumericError
fn clone(&self) -> OutOfRangeNumericError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OutOfRangeNumericError
impl Debug for OutOfRangeNumericError
Source§impl Display for OutOfRangeNumericError
impl Display for OutOfRangeNumericError
Source§impl Error for OutOfRangeNumericError
impl Error for OutOfRangeNumericError
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 PartialEq for OutOfRangeNumericError
impl PartialEq for OutOfRangeNumericError
Source§fn eq(&self, other: &OutOfRangeNumericError) -> bool
fn eq(&self, other: &OutOfRangeNumericError) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Structable for OutOfRangeNumericError
Available on crate feature valuable only.
impl Structable for OutOfRangeNumericError
Available on crate feature
valuable only.Source§fn definition(&self) -> StructDef<'_>
fn definition(&self) -> StructDef<'_>
Returns the struct’s definition. Read more
Source§impl Valuable for OutOfRangeNumericError
Available on crate feature valuable only.
impl Valuable for OutOfRangeNumericError
Available on crate feature
valuable only.impl Eq for OutOfRangeNumericError
impl StructuralPartialEq for OutOfRangeNumericError
Auto Trait Implementations§
impl Freeze for OutOfRangeNumericError
impl RefUnwindSafe for OutOfRangeNumericError
impl Send for OutOfRangeNumericError
impl Sync for OutOfRangeNumericError
impl Unpin for OutOfRangeNumericError
impl UnsafeUnpin for OutOfRangeNumericError
impl UnwindSafe for OutOfRangeNumericError
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