Skip to main content

OutcomeBatch

Struct OutcomeBatch 

Source
pub struct OutcomeBatch<W: Worker>(/* private fields */);
Expand description

A batch of Outcomes.

Trait Implementations§

Source§

impl<W: Worker> Debug for OutcomeBatch<W>

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: Worker, I: IntoIterator<Item = Outcome<W>>> From<I> for OutcomeBatch<W>

Source§

fn from(value: I) -> Self

Converts to this type from the input type.

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>
where <W as Worker>::Output: Unpin, <W as Worker>::Error: Unpin, <W as Worker>::Input: Unpin,

§

impl<W> UnsafeUnpin for OutcomeBatch<W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W, D> OutcomeStore<W> for D
where W: Worker, D: DerefOutcomes<W>,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Returns true if there are no stored outcomes.
Source§

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)

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

Returns true if any of the outcomes are Outcome::Unprocessed.
Source§

fn num_unprocessed(&self) -> usize

Returns the number of unprocessed outcomes in this store.
Source§

fn unprocessed_task_ids(&self) -> Vec<TaskId>

Returns the task IDs of the unprocessed outcomes.
Source§

fn has_successes(&self) -> bool

Returns true if any of the outcomes are Outcome::Success.
Source§

fn num_successes(&self) -> usize

Returns the number of success outcomes in this store.
Source§

fn success_task_ids(&self) -> Vec<TaskId>

Returns the task IDs of the success outcomes.
Source§

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

Returns the number of failure outcomes in this store.
Source§

fn failure_task_ids(&self) -> Vec<TaskId>

Returns the task IDs of the success outcomes.
Source§

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>>

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>

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)>

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>

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)>

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>>

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>>

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>,

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>,

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>,

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>,

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>,

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>,

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>,

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>,

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§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.