pub struct AsyncGroup { /* private fields */ }Expand description
The structure that allows for the concurrent execution of multiple functions
using std::thread and waits for all of them to complete.
Functions are added using the add method and are then run concurrently in separate 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<F>(&mut self, f: F)
pub fn add<F>(&mut self, f: F)
Adds a task (a closure) to the group to be executed concurrently.
This provided closure is executed in a new std::thread concurrently
with other added tasks.
§Type Parameters
F: The type of the closure, which must beFnOnce() -> errs::Result<()> + Send + 'static.
§Parameters
f: The closure to be executed in a separate thread.
Auto Trait Implementations§
impl Freeze for AsyncGroup
impl !RefUnwindSafe for AsyncGroup
impl Send for AsyncGroup
impl Sync for AsyncGroup
impl Unpin for AsyncGroup
impl !UnwindSafe 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