[−][src]Struct dispatch::Group
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]
F: 'static + Send + FnOnce(),
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]
F: 'static + Send + FnOnce(),
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(&self) -> Self
[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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,