pub struct RangeError {
pub label: &'static str,
pub values: [u64; 2],
}Expand description
A value a checked constructor refused for lying outside the range its type takes, such as an object instance past 4,194,303 (#1646).
Like DecodeError it carries a static label and up to two numbers,
formatted when displayed. It displays as value out of range: {label}.
Fields§
§label: &'static strWhat is out of range, such as "instance number {} exceeds max 4194303".
values: [u64; 2]The numbers the label’s placeholders stand for, in order; a slot with no placeholder is 0.
Implementations§
Source§impl RangeError
impl RangeError
Sourcepub const fn with_value(self, value: u64) -> Self
pub const fn with_value(self, value: u64) -> Self
The same refusal, with the number the label’s one placeholder stands for.
Sourcepub const fn with_values(self, first: u64, second: u64) -> Self
pub const fn with_values(self, first: u64, second: u64) -> Self
The same refusal, with the numbers the label’s two placeholders stand for.
Trait Implementations§
Source§impl Clone for RangeError
impl Clone for RangeError
impl Copy for RangeError
Source§impl Debug for RangeError
impl Debug for RangeError
Source§impl Display for RangeError
impl Display for RangeError
impl Eq for RangeError
Source§impl Error for RangeError
impl Error for RangeError
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 From<RangeError> for Error
impl From<RangeError> for Error
Source§fn from(error: RangeError) -> Self
fn from(error: RangeError) -> Self
Converts to this type from the input type.
Source§impl Hash for RangeError
impl Hash for RangeError
Source§impl PartialEq for RangeError
impl PartialEq for RangeError
impl StructuralPartialEq for RangeError
Auto Trait Implementations§
impl Freeze for RangeError
impl RefUnwindSafe for RangeError
impl Send for RangeError
impl Sync for RangeError
impl Unpin for RangeError
impl UnsafeUnpin for RangeError
impl UnwindSafe for RangeError
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