pub struct BatchTaskFailure<E> { /* private fields */ }Expand description
Failure record for one task inside a batch.
Each failure keeps the task’s stable batch index so callers can map the failure back to the source task.
use qubit_batch::{
BatchTaskError,
BatchTaskFailure,
};
let failure = BatchTaskFailure::new(2, BatchTaskError::Failed("invalid row"));
assert_eq!(failure.index(), 2);
assert!(failure.error().is_failed());§Type Parameters
E- The task-specific error type.
Implementations§
Source§impl<E> BatchTaskFailure<E>
impl<E> BatchTaskFailure<E>
Sourcepub fn new(index: usize, error: BatchTaskError<E>) -> Self
pub fn new(index: usize, error: BatchTaskError<E>) -> Self
Sourcepub const fn index(&self) -> usize
pub const fn index(&self) -> usize
Returns the failed task’s zero-based batch index.
§Returns
The task index recorded for this failure.
Sourcepub const fn error(&self) -> &BatchTaskError<E>
pub const fn error(&self) -> &BatchTaskError<E>
Sourcepub fn into_error(self) -> BatchTaskError<E>
pub fn into_error(self) -> BatchTaskError<E>
Consumes this failure record and returns the stored task error.
§Returns
The task error previously stored in this failure record.
Trait Implementations§
Source§impl<E: Clone> Clone for BatchTaskFailure<E>
impl<E: Clone> Clone for BatchTaskFailure<E>
Source§fn clone(&self) -> BatchTaskFailure<E>
fn clone(&self) -> BatchTaskFailure<E>
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<E: Debug> Debug for BatchTaskFailure<E>
impl<E: Debug> Debug for BatchTaskFailure<E>
Source§impl<E: PartialEq> PartialEq for BatchTaskFailure<E>
impl<E: PartialEq> PartialEq for BatchTaskFailure<E>
Source§fn eq(&self, other: &BatchTaskFailure<E>) -> bool
fn eq(&self, other: &BatchTaskFailure<E>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<E: Eq> Eq for BatchTaskFailure<E>
impl<E> StructuralPartialEq for BatchTaskFailure<E>
Auto Trait Implementations§
impl<E> Freeze for BatchTaskFailure<E>where
E: Freeze,
impl<E> RefUnwindSafe for BatchTaskFailure<E>where
E: RefUnwindSafe,
impl<E> Send for BatchTaskFailure<E>where
E: Send,
impl<E> Sync for BatchTaskFailure<E>where
E: Sync,
impl<E> Unpin for BatchTaskFailure<E>where
E: Unpin,
impl<E> UnsafeUnpin for BatchTaskFailure<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for BatchTaskFailure<E>where
E: 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