pub enum VotingError {
MaxSamplesExceeded {
samples: u32,
votes: HashMap<String, u32>,
},
AllSamplesRedFlagged {
red_flagged: u32,
total: u32,
},
Cancelled,
NoValidResponses {
attempts: u32,
},
SamplerError(String),
HashError,
InvalidK(u32),
ParallelError(String),
}Expand description
Errors related to the first-to-ahead-by-k voting system (Algorithm 2)
Variants§
MaxSamplesExceeded
Maximum samples exceeded without reaching consensus.
Fields
AllSamplesRedFlagged
All samples were red-flagged as invalid.
Cancelled
Voting was cancelled.
NoValidResponses
No valid responses received.
SamplerError(String)
Sampler returned an error.
HashError
Unable to hash a response for comparison.
InvalidK(u32)
Invalid k value (must be >= 1).
ParallelError(String)
Parallel execution error.
Trait Implementations§
Source§impl Debug for VotingError
impl Debug for VotingError
Source§impl Display for VotingError
impl Display for VotingError
Source§impl Error for VotingError
impl Error for VotingError
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<VotingError> for MdapError
impl From<VotingError> for MdapError
Source§fn from(source: VotingError) -> Self
fn from(source: VotingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VotingError
impl RefUnwindSafe for VotingError
impl Send for VotingError
impl Sync for VotingError
impl Unpin for VotingError
impl UnsafeUnpin for VotingError
impl UnwindSafe for VotingError
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