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 ==.impl StructuralPartialEq for RandomSlicesError
Auto Trait Implementations§
impl Freeze for RandomSlicesError
impl RefUnwindSafe for RandomSlicesError
impl Send for RandomSlicesError
impl Sync for RandomSlicesError
impl Unpin for RandomSlicesError
impl UnsafeUnpin for RandomSlicesError
impl UnwindSafe for RandomSlicesError
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.