[][src]Struct dispatch::Group

pub struct Group { /* fields omitted */ }

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.

Methods

impl Group[src]

pub fn create() -> Group[src]

Creates a new dispatch Group.

pub fn enter(&self) -> GroupGuard[src]

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.

pub fn async<F>(&self, queue: &Queue, work: F) where
    F: 'static + Send + FnOnce(), 
[src]

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

pub fn notify<F>(&self, queue: &Queue, work: F) where
    F: 'static + Send + FnOnce(), 
[src]

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.

pub fn wait(&self)[src]

Waits synchronously for all tasks associated with self to complete.

pub fn wait_timeout_ms(&self, ms: u32) -> bool[src]

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.

pub fn wait_timeout(&self, timeout: Duration) -> bool[src]

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.

pub fn is_empty(&self) -> bool[src]

Returns whether self is currently empty.

Trait Implementations

impl Sync for Group[src]

impl Clone for Group[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Drop for Group[src]

impl Send for Group[src]

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]