pub struct TaskQueue { /* private fields */ }Expand description
An aggregator of async work that can be used to observe the moment when all
the aggregated work is completed. It is similar to tokio’s JoinSet, but is
relatively constrained and also works on wasm32-unknown-unknown. Unlike
JoinSet, the results can not be observed individually.
let mut task_queue = TaskQueue::default();
for i in 0..10 {
task_queue.spawn(async move {
println!("{}", i);
Ok(())
});
}
task_queue.join().await?;Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskQueue
impl !RefUnwindSafe for TaskQueue
impl Send for TaskQueue
impl Sync for TaskQueue
impl Unpin for TaskQueue
impl !UnwindSafe for TaskQueue
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