[][src]Struct af_lib::prelude::af_core::task::Join

pub struct Join<T> { /* fields omitted */ }

Concurrently waits for the results of multiple tasks.

Implementations

impl<T> Join<T> where
    T: Send + 'static, 
[src]

pub fn new() -> Join<T>[src]

Creates an empty join.

pub fn add(&mut self, task: impl Start<T>) -> usize[src]

Adds a task to the join, returning its index.

pub fn add_as(
    &mut self,
    name: impl Into<SharedString>,
    task: impl Start<T>
) -> usize
[src]

Adds a named task to the join, returning its index.

pub async fn next(&'_ mut self) -> Option<StoppedTask<Result<T, Panic>>>[src]

Waits for the next stopped task.

If all tasks have stopped, this function returns None.

pub async fn try_next(
    &'_ mut self
) -> Option<Result<StoppedTask<T>, PanickedTask>>
[src]

Waits for the next stopped task and returns its information as a Result.

If all tasks have stopped, this function returns None.

pub async fn drain(&'_ mut self)[src]

Waits for all tasks to stop, dropping their results.

pub async fn try_drain(&'_ mut self) -> Result<(), PanickedTask>[src]

Waits for all tasks to stop, dropping their results, until a task panics.

Trait Implementations

impl<T> Default for Join<T> where
    T: Send + 'static, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Join<T>[src]

impl<T> Send for Join<T> where
    T: Send
[src]

impl<T> Sync for Join<T> where
    T: Send
[src]

impl<T> Unpin for Join<T>[src]

impl<T> UnwindSafe for Join<T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,