pub enum WeightedQuorumSetError<ID> {
ZeroWeight {
id: ID,
},
ZeroThreshold,
}Expand description
An error returned when building an invalid WeightedQuorumSet.
Both cases are caller bugs: an ID with weight 0 would never count, and a threshold of 0 would make the empty set a quorum. Construction reports them instead of repairing the input, so the mistake surfaces where it is made.
Variants§
ZeroWeight
An ID has weight 0, so it would never count.
Fields
§
id: IDThe first ID with weight 0.
ZeroThreshold
The threshold is 0, so the empty set would be a quorum.
Trait Implementations§
Source§impl<ID: Clone> Clone for WeightedQuorumSetError<ID>
impl<ID: Clone> Clone for WeightedQuorumSetError<ID>
Source§impl<ID: Debug> Debug for WeightedQuorumSetError<ID>
impl<ID: Debug> Debug for WeightedQuorumSetError<ID>
Source§impl<ID> Display for WeightedQuorumSetError<ID>where
ID: Display,
impl<ID> Display for WeightedQuorumSetError<ID>where
ID: Display,
impl<ID: Eq> Eq for WeightedQuorumSetError<ID>
Source§impl<ID> Error for WeightedQuorumSetError<ID>
impl<ID> Error for WeightedQuorumSetError<ID>
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<ID: PartialEq> PartialEq for WeightedQuorumSetError<ID>
impl<ID: PartialEq> PartialEq for WeightedQuorumSetError<ID>
impl<ID: PartialEq> StructuralPartialEq for WeightedQuorumSetError<ID>
Auto Trait Implementations§
impl<ID> Forget for WeightedQuorumSetError<ID>
impl<ID> Freeze for WeightedQuorumSetError<ID>where
ID: Freeze,
impl<ID> RefUnwindSafe for WeightedQuorumSetError<ID>where
ID: RefUnwindSafe,
impl<ID> Send for WeightedQuorumSetError<ID>where
ID: Send,
impl<ID> Sync for WeightedQuorumSetError<ID>where
ID: Sync,
impl<ID> Unpin for WeightedQuorumSetError<ID>where
ID: Unpin,
impl<ID> UnsafeUnpin for WeightedQuorumSetError<ID>where
ID: UnsafeUnpin,
impl<ID> UnwindSafe for WeightedQuorumSetError<ID>where
ID: UnwindSafe,
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