pub enum BatchOutcomeBuildError {
CompletedCountExceeded {
task_count: usize,
completed_count: usize,
},
FailureCountOverflow {
failed_count: usize,
panicked_count: usize,
},
TerminalCountOverflow {
succeeded_count: usize,
failure_count: usize,
},
TerminalCountMismatch {
completed_count: usize,
terminal_count: usize,
succeeded_count: usize,
failed_count: usize,
panicked_count: usize,
},
FailureDetailCountMismatch {
expected: usize,
actual: usize,
},
FailureIndexOutOfRange {
index: usize,
task_count: usize,
},
DuplicateFailureIndex {
index: usize,
},
FailureVariantCountMismatch {
expected_failed: usize,
actual_failed: usize,
expected_panicked: usize,
actual_panicked: usize,
},
}Expand description
Error returned when constructing a batch outcome with invalid counters.
use qubit_batch::{
BatchOutcomeBuildError,
BatchOutcomeBuilder,
};
let error = BatchOutcomeBuilder::<&'static str>::builder(1)
.completed_count(2)
.succeeded_count(2)
.build()
.expect_err("completed count should not exceed declared task count");
assert!(matches!(
error,
BatchOutcomeBuildError::CompletedCountExceeded { .. }
));Variants§
CompletedCountExceeded
The completed task count is greater than the declared task count.
FailureCountOverflow
Adding failed and panicked task counts overflowed.
Fields
TerminalCountOverflow
Adding successful and failed task counts overflowed.
Fields
TerminalCountMismatch
Completed tasks do not equal successful plus failed plus panicked tasks.
Fields
FailureDetailCountMismatch
Detailed failure records do not match the aggregate failure count.
Fields
FailureIndexOutOfRange
A failure detail index is outside the declared task range.
DuplicateFailureIndex
Multiple failure details refer to the same task index.
FailureVariantCountMismatch
Detailed failure variants do not match failed and panicked counters.
Trait Implementations§
Source§impl Clone for BatchOutcomeBuildError
impl Clone for BatchOutcomeBuildError
Source§fn clone(&self) -> BatchOutcomeBuildError
fn clone(&self) -> BatchOutcomeBuildError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatchOutcomeBuildError
impl Debug for BatchOutcomeBuildError
Source§impl Display for BatchOutcomeBuildError
impl Display for BatchOutcomeBuildError
Source§impl Error for BatchOutcomeBuildError
impl Error for BatchOutcomeBuildError
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 PartialEq for BatchOutcomeBuildError
impl PartialEq for BatchOutcomeBuildError
Source§fn eq(&self, other: &BatchOutcomeBuildError) -> bool
fn eq(&self, other: &BatchOutcomeBuildError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for BatchOutcomeBuildError
impl StructuralPartialEq for BatchOutcomeBuildError
Auto Trait Implementations§
impl Freeze for BatchOutcomeBuildError
impl RefUnwindSafe for BatchOutcomeBuildError
impl Send for BatchOutcomeBuildError
impl Sync for BatchOutcomeBuildError
impl Unpin for BatchOutcomeBuildError
impl UnsafeUnpin for BatchOutcomeBuildError
impl UnwindSafe for BatchOutcomeBuildError
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