Struct dispatch::Group

source ·
pub struct Group { /* private fields */ }
Expand description

A Grand Central Dispatch group.

A Group is a mechanism for grouping closures and monitoring them. This allows for aggregate synchronization, so you can track when all the closures complete, even if they are running on different queues.

Implementations

Creates a new dispatch Group.

Indicates that a closure has entered self, and increments the current count of outstanding tasks. Returns a GroupGuard that should be dropped when the closure leaves self, decrementing the count.

Submits a closure asynchronously to the given Queue and associates it with self.

Schedules a closure to be submitted to the given Queue when all tasks associated with self have completed. If self is empty, the closure is submitted immediately.

Waits synchronously for all tasks associated with self to complete.

Waits for all tasks associated with self to complete within the specified duration. Returns true if the tasks completed or false if the timeout elapsed.

Waits for all tasks associated with self to complete within the specified duration. Returns true if the tasks completed or false if the timeout elapsed.

Returns whether self is currently empty.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.