Enum WeightValidationError
pub enum WeightValidationError {
Empty,
Capacity {
len: usize,
max: usize,
},
ZeroTotal,
Overflow {
index: usize,
partial_total: u64,
weight: u64,
},
}Expand description
Detailed validation failure, without consuming randomness or allocating.
Length is checked first; otherwise the first overflowing entry is reported.
Zero weights are valid unless every entry is zero. Convert into WeightError
when only the original compatibility category is needed.
Variants§
Empty
No entries were supplied.
Capacity
The entry count exceeds the table’s bound, including disabled entries.
ZeroTotal
Every entry has zero weight; at least one positive weight is required.
Overflow
This entry would make the total exceed u64::MAX.
Trait Implementations§
§impl Clone for WeightValidationError
impl Clone for WeightValidationError
§fn clone(&self) -> WeightValidationError
fn clone(&self) -> WeightValidationError
Returns a duplicate 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 more§impl Debug for WeightValidationError
impl Debug for WeightValidationError
§impl Display for WeightValidationError
impl Display for WeightValidationError
§impl Error for WeightValidationError
impl Error for WeightValidationError
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()
§impl From<WeightValidationError> for WeightError
impl From<WeightValidationError> for WeightError
§fn from(error: WeightValidationError) -> WeightError
fn from(error: WeightValidationError) -> WeightError
Converts to this type from the input type.
§impl PartialEq for WeightValidationError
impl PartialEq for WeightValidationError
impl Copy for WeightValidationError
impl Eq for WeightValidationError
impl StructuralPartialEq for WeightValidationError
Auto Trait Implementations§
impl Freeze for WeightValidationError
impl RefUnwindSafe for WeightValidationError
impl Send for WeightValidationError
impl Sync for WeightValidationError
impl Unpin for WeightValidationError
impl UnwindSafe for WeightValidationError
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