Struct af_core::task::try_join::TryJoin [−][src]
Concurrently waits for the results of multiple tasks that may return an error.
Implementations
impl<T, E> TryJoin<T, E> where
T: Send + 'static,
E: From<Panic> + Send + 'static, [src]
T: Send + 'static,
E: From<Panic> + Send + 'static,
pub fn new() -> Self[src]
Creates an empty join.
pub fn add(&mut self, task: impl Start<Result<T, E>>) -> Index[src]
Adds a task to the join, returning its index.
pub fn add_as(
&mut self,
name: impl Into<SharedString>,
task: impl Start<Result<T, E>>
) -> Index[src]
&mut self,
name: impl Into<SharedString>,
task: impl Start<Result<T, E>>
) -> Index
Adds a named task to the join, returning its index.
pub async fn next(&mut self) -> Option<StoppedTask<T, E>>[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<FinishedTask<T>, FailedTask<E>>>[src]
&mut self
) -> Option<Result<FinishedTask<T>, FailedTask<E>>>
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<(), FailedTask<E>>[src]
Waits for all tasks to stop, dropping their results, until a task fails.
Methods from Deref<Target = Join<Result<T, E>>>
pub fn add(&mut self, task: impl Start<T>) -> Index[src]
Adds a task to the join, returning its index.
pub fn add_as(
&mut self,
name: impl Into<SharedString>,
task: impl Start<T>
) -> Index[src]
&mut self,
name: impl Into<SharedString>,
task: impl Start<T>
) -> Index
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, E> Default for TryJoin<T, E> where
T: Send + 'static,
E: From<Panic> + Send + 'static, [src]
T: Send + 'static,
E: From<Panic> + Send + 'static,
impl<T, E> Deref for TryJoin<T, E>[src]
type Target = Join<Result<T, E>>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
impl<T, E> DerefMut for TryJoin<T, E>[src]
Auto Trait Implementations
impl<T, E> RefUnwindSafe for TryJoin<T, E>
impl<T, E> Send for TryJoin<T, E> where
E: Send,
T: Send,
E: Send,
T: Send,
impl<T, E> Sync for TryJoin<T, E> where
E: Send,
T: Send,
E: Send,
T: Send,
impl<T, E> Unpin for TryJoin<T, E>
impl<T, E> UnwindSafe for TryJoin<T, E>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut Tⓘ[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,