pub struct AsyncGroup<'a> { /* private fields */ }
Expand description
The structure that allows for the asynchronous execution of multiple functions and waits for all of them to complete.
Functions are added using the add
method and are then run concurrently.
The AsyncGroup
ensures that all tasks finish before proceeding,
and can collect any errors that occur.
Implementations§
Source§impl<'a> AsyncGroup<'_>
impl<'a> AsyncGroup<'_>
Sourcepub fn add<Fut>(&mut self, future: Fut)
pub fn add<Fut>(&mut self, future: Fut)
Adds an asynchronous task (a future) to the group.
This provided future is executed asynchronously with other added tasks, awaiting completion and collecting errors internally.
§Type Parameters
Fut
: The type of the future, which must beFuture<Output = Result<(), Err>> + Send + 'static
.
§Parameters
future
: The future to be executed.
Auto Trait Implementations§
impl<'a> Freeze for AsyncGroup<'a>
impl<'a> !RefUnwindSafe for AsyncGroup<'a>
impl<'a> Send for AsyncGroup<'a>
impl<'a> !Sync for AsyncGroup<'a>
impl<'a> Unpin for AsyncGroup<'a>
impl<'a> !UnwindSafe for AsyncGroup<'a>
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