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