pub struct AsyncGroup { /* private fields */ }Available on crate feature
tokio only.Expand description
The structure that allows for the concurrent execution of multiple asynchronous tasks using green-thread and waits for all of them to complete.
Functions are added using the add method and are then run concurrently in separate green-threads.
The AsyncGroup ensures that all tasks finish before proceeding,
and can collect any errors that occur.
Implementations§
Source§impl AsyncGroup
impl AsyncGroup
Sourcepub fn add<Fut>(&mut self, future: Fut)
pub fn add<Fut>(&mut self, future: Fut)
Adds a future to the AsyncGroup to be executed concurrently.
The provided future will be polled along with others in this group.
§Parameters
future- The future to add. It must implementFuture<Output = errs::Result<()>>,Send, and have a'staticlifetime.
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncGroup
impl !Sync for AsyncGroup
impl !UnwindSafe for AsyncGroup
impl Freeze for AsyncGroup
impl Send for AsyncGroup
impl Unpin for AsyncGroup
impl UnsafeUnpin for AsyncGroup
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