pub enum RandomSlicesError {
EmptyClaimants,
DuplicateClaimant {
name: String,
},
InvalidWeight {
name: String,
weight: f64,
},
OversizedSizeSum {
sum: u128,
},
ZeroInterval {
index: usize,
name: String,
},
}Expand description
Failure mode produced by the RandomSlices builders.
Variants§
EmptyClaimants
Caller supplied an empty claimant list. The reference engine refuses to build an empty partition; we mirror that here.
DuplicateClaimant
Two claimants share the same name. Names must be unique so the reverse lookup (peer name -> slice) is total.
InvalidWeight
A weight is non-finite, negative, or so large the size translation cannot proceed. The error is also raised when every weight rounds to zero at the configured number of decimal digits.
OversizedSizeSum
The summed u64 sizes overflow the ring. The C
reference’s hash_partitions_create_with_sizes accepts
only sums up to u64::MAX; anything beyond is a
configuration error.
ZeroInterval
Caller supplied a zero-sized interval. The reference engine permits zero-sized entries silently and the binary search then returns the next claimant; the Rust port rejects this configuration up front so no claimant can be silently masked.
Trait Implementations§
Source§impl Debug for RandomSlicesError
impl Debug for RandomSlicesError
Source§impl Display for RandomSlicesError
impl Display for RandomSlicesError
Source§impl Error for RandomSlicesError
impl Error for RandomSlicesError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for RandomSlicesError
impl PartialEq for RandomSlicesError
Source§fn eq(&self, other: &RandomSlicesError) -> bool
fn eq(&self, other: &RandomSlicesError) -> bool
self and other values to be equal, and is used by ==.