pub struct OutcomeBatch<W: Worker>(/* private fields */);Expand description
A batch of Outcomes.
Trait Implementations§
Source§impl<W: Worker> Debug for OutcomeBatch<W>
impl<W: Worker> Debug for OutcomeBatch<W>
Source§impl<W: Worker, I: IntoIterator<Item = Outcome<W>>> From<I> for OutcomeBatch<W>
impl<W: Worker, I: IntoIterator<Item = Outcome<W>>> From<I> for OutcomeBatch<W>
Auto Trait Implementations§
impl<W> !RefUnwindSafe for OutcomeBatch<W>
impl<W> !Sync for OutcomeBatch<W>
impl<W> !UnwindSafe for OutcomeBatch<W>
impl<W> Freeze for OutcomeBatch<W>
impl<W> Send for OutcomeBatch<W>
impl<W> Unpin for OutcomeBatch<W>
impl<W> UnsafeUnpin for OutcomeBatch<W>
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
Source§impl<W, D> OutcomeStore<W> for Dwhere
W: Worker,
D: DerefOutcomes<W>,
impl<W, D> OutcomeStore<W> for Dwhere
W: Worker,
D: DerefOutcomes<W>,
fn len(&self) -> usize
Source§fn count(&self) -> (usize, usize, usize)
fn count(&self) -> (usize, usize, usize)
Returns counts of the outcomes as a tuple
(unprocessed, successes, failures).Source§fn assert_empty(&self, allow_successes: bool)
fn assert_empty(&self, allow_successes: bool)
Panics if there are stored outcomes. If
allow_successes is true, then
Outcome::Success outcomes do not cause a panic.Source§fn has_unprocessed(&self) -> bool
fn has_unprocessed(&self) -> bool
Returns
true if any of the outcomes are Outcome::Unprocessed.Source§fn num_unprocessed(&self) -> usize
fn num_unprocessed(&self) -> usize
Returns the number of unprocessed outcomes in this store.
Source§fn unprocessed_task_ids(&self) -> Vec<TaskId> ⓘ
fn unprocessed_task_ids(&self) -> Vec<TaskId> ⓘ
Returns the task IDs of the unprocessed outcomes.
Source§fn has_successes(&self) -> bool
fn has_successes(&self) -> bool
Returns
true if any of the outcomes are Outcome::Success.Source§fn num_successes(&self) -> usize
fn num_successes(&self) -> usize
Returns the number of success outcomes in this store.
Source§fn has_failures(&self) -> bool
fn has_failures(&self) -> bool
Returns
true if any of the outcomes are Outcome::Failure, Outcome::Panic, or
[Outcome::MaxRetriesAttempted] (if the retry feature is enabled).Source§fn num_failures(&self) -> usize
fn num_failures(&self) -> usize
Returns the number of failure outcomes in this store.
Source§fn remove(&mut self, task_id: TaskId) -> Option<Outcome<W>>
fn remove(&mut self, task_id: TaskId) -> Option<Outcome<W>>
Removes the outcome with the given
task_id``. Returns None` if the task ID does not exist.Source§fn remove_all(&mut self) -> Vec<Outcome<W>>
fn remove_all(&mut self) -> Vec<Outcome<W>>
Removes all outcomes from this store. Returns a
Vec containing the removed outcomes.Source§fn remove_unprocessed(&mut self, task_id: TaskId) -> Option<W::Input>
fn remove_unprocessed(&mut self, task_id: TaskId) -> Option<W::Input>
Removes the outcome with the given
task_id and returns its value. Returns None if the
task ID does not exist. Panics if the outcome is not Outcome::Unprocessed.Source§fn remove_all_unprocessed(&mut self) -> Vec<(TaskId, W::Input)>
fn remove_all_unprocessed(&mut self) -> Vec<(TaskId, W::Input)>
Removes and returns all unprocessed outcomes as a
Vec of tuples (task_id, value).Source§fn remove_success(&mut self, task_id: TaskId) -> Option<W::Output>
fn remove_success(&mut self, task_id: TaskId) -> Option<W::Output>
Removes the outcome with the given
task_id y and returns its value. Returns None if the task ID does not exist. Panics if the outcome is not [Outcome::Success`].Source§fn remove_all_successes(&mut self) -> Vec<(TaskId, W::Output)>
fn remove_all_successes(&mut self) -> Vec<(TaskId, W::Output)>
Removes and returns all success outcomes as a
Vec of tuples (task_id, value).Source§fn remove_failure(&mut self, task_id: TaskId) -> Option<Outcome<W>>
fn remove_failure(&mut self, task_id: TaskId) -> Option<Outcome<W>>
Removes the outcome with the given
task_id and returns its value. Returns None if the
task ID does not exist. Panics if the outcome is not a failure outcome.Source§fn remove_all_failures(&mut self) -> Vec<Outcome<W>>
fn remove_all_failures(&mut self) -> Vec<Outcome<W>>
Removes and returns all failure outcomes as a
Vec of tuples (task_id, value).Source§fn get(&self, task_id: TaskId) -> Option<&Outcome<W>>where
Self: OwnedOutcomes<W>,
fn get(&self, task_id: TaskId) -> Option<&Outcome<W>>where
Self: OwnedOutcomes<W>,
Returns the stored
Outcome associated with the given task_id, if any.Source§fn into_iter(self) -> impl Iterator<Item = Outcome<W>>where
Self: OwnedOutcomes<W>,
fn into_iter(self) -> impl Iterator<Item = Outcome<W>>where
Self: OwnedOutcomes<W>,
Consumes this store and returns an iterator over the outcomes in task_id order.
Source§fn unwrap(self) -> Vec<W::Output>where
Self: OwnedOutcomes<W>,
fn unwrap(self) -> Vec<W::Output>where
Self: OwnedOutcomes<W>,
Returns the successes as a
Vec if there are no errors, otherwise panics.Source§fn ok_or_unwrap_errors(
self,
drop_unprocessed: bool,
) -> Result<Vec<W::Output>, Vec<W::Error>>where
Self: OwnedOutcomes<W>,
fn ok_or_unwrap_errors(
self,
drop_unprocessed: bool,
) -> Result<Vec<W::Output>, Vec<W::Error>>where
Self: OwnedOutcomes<W>,
Returns a
std::result::Result: Ok(Vec<W::Output>) if there are no errors, otherwise
Err(Vec<W::Error>). If there are any Outcome::Panic variants, resumes unwinding the
first panic. If drop_unprocessed is true, unprocessed inputs are discarded, otherwise
they cause this method to panic.Source§fn into_unprocessed(self, ordered: bool) -> Vec<W::Input>where
Self: OwnedOutcomes<W>,
fn into_unprocessed(self, ordered: bool) -> Vec<W::Input>where
Self: OwnedOutcomes<W>,
Consumes this store and returns all the
Outcome::Unprocessed. If ordered is true, the
inputs are returned in task_id order, otherwise they are unordered.Source§fn iter_unprocessed(&self) -> impl Iterator<Item = (&TaskId, &W::Input)>where
Self: OwnedOutcomes<W>,
fn iter_unprocessed(&self) -> impl Iterator<Item = (&TaskId, &W::Input)>where
Self: OwnedOutcomes<W>,
Returns an iterator over all the stored
Outcome::Unprocessed outcomes. These are tasks
that were queued but not yet processed when the Hive was dropped.Source§fn iter_successes(&self) -> impl Iterator<Item = (&TaskId, &W::Output)>where
Self: OwnedOutcomes<W>,
fn iter_successes(&self) -> impl Iterator<Item = (&TaskId, &W::Output)>where
Self: OwnedOutcomes<W>,
Returns an iterator over all the stored
Outcome::Success outcomes. These are tasks
that were successfully processed but not sent to any output channel.Source§fn iter_failures(&self) -> impl Iterator<Item = &Outcome<W>>where
Self: OwnedOutcomes<W>,
fn iter_failures(&self) -> impl Iterator<Item = &Outcome<W>>where
Self: OwnedOutcomes<W>,
Returns an iterator over all the stored
Outcome::Success outcomes. These are tasks
that were successfully processed but not sent to any output channel.