#[repr(C)]pub struct DispatchGroup { /* private fields */ }Expand description
Dispatch group.
Implementations§
Source§impl DispatchGroup
impl DispatchGroup
Sourcepub fn new() -> DispatchRetained<DispatchGroup> ⓘ
pub fn new() -> DispatchRetained<DispatchGroup> ⓘ
Creates new group with which blocks may be associated.
This function creates a new group with which blocks may be associated. The dispatch group may be used to wait for the completion of the blocks it references. The group object memory is freed with dispatch_release().
Returns: The newly created group, or NULL on failure.
pub unsafe fn exec_async_with_block( self: &DispatchGroup, queue: &DispatchQueue, block: dispatch_block_t, )
Sourcepub unsafe fn exec_async_f(
self: &DispatchGroup,
queue: &DispatchQueue,
context: *mut c_void,
work: dispatch_function_t,
)
pub unsafe fn exec_async_f( self: &DispatchGroup, queue: &DispatchQueue, context: *mut c_void, work: dispatch_function_t, )
Submits a function to a dispatch queue and associates the block with the given dispatch group.
See dispatch_group_async() for details.
Parameter group: A dispatch group to associate with the submitted function.
The result of passing NULL in this parameter is undefined.
Parameter queue: The dispatch queue to which the function will be submitted for asynchronous
invocation.
Parameter context: The application-defined context parameter to pass to the function.
Parameter work: The application-defined function to invoke on the target queue. The first
parameter passed to this function is the context provided to
dispatch_group_async_f().
Source§impl DispatchGroup
impl DispatchGroup
pub unsafe fn notify_with_block( self: &DispatchGroup, queue: &DispatchQueue, block: dispatch_block_t, )
Sourcepub unsafe fn notify_f(
self: &DispatchGroup,
queue: &DispatchQueue,
context: *mut c_void,
work: dispatch_function_t,
)
pub unsafe fn notify_f( self: &DispatchGroup, queue: &DispatchQueue, context: *mut c_void, work: dispatch_function_t, )
Schedule a function to be submitted to a queue when all the blocks associated with a group have completed.
See dispatch_group_notify() for details.
Parameter group: The dispatch group to observe.
The result of passing NULL in this parameter is undefined.
Parameter context: The application-defined context parameter to pass to the function.
Parameter work: The application-defined function to invoke on the target queue. The first
parameter passed to this function is the context provided to
dispatch_group_notify_f().
Source§impl DispatchGroup
impl DispatchGroup
Sourcepub unsafe fn leave(self: &DispatchGroup)
pub unsafe fn leave(self: &DispatchGroup)
Manually indicate a block in the group has completed
Calling this function indicates block has completed and left the dispatch group by a means other than dispatch_group_async().
Parameter group: The dispatch group to update.
The result of passing NULL in this parameter is undefined.
Source§impl DispatchGroup
impl DispatchGroup
Sourcepub fn exec_async<F>(&self, queue: &DispatchQueue, work: F)
pub fn exec_async<F>(&self, queue: &DispatchQueue, work: F)
Submit a function to a DispatchQueue and associates it with the DispatchGroup.
Sourcepub fn wait(&self, timeout: DispatchTime) -> Result<(), WaitError>
pub fn wait(&self, timeout: DispatchTime) -> Result<(), WaitError>
Wait synchronously for the previously submitted functions to finish.
§Errors
Return WaitError::Timeout in case of timeout.
Sourcepub fn notify<F>(&self, queue: &DispatchQueue, work: F)
pub fn notify<F>(&self, queue: &DispatchQueue, work: F)
Schedule a function to be submitted to a DispatchQueue when a group of previously submitted functions have completed.
Sourcepub fn enter(&self) -> DispatchGroupGuard
pub fn enter(&self) -> DispatchGroupGuard
Explicitly indicates that the function has entered the DispatchGroup.
Trait Implementations§
Source§impl AsRef<AnyObject> for DispatchGroup
impl AsRef<AnyObject> for DispatchGroup
Source§impl AsRef<DispatchGroup> for DispatchGroup
impl AsRef<DispatchGroup> for DispatchGroup
Source§impl Debug for DispatchGroup
impl Debug for DispatchGroup
Source§impl DispatchObject for DispatchGroup
impl DispatchObject for DispatchGroup
Source§fn retain(&self) -> DispatchRetained<Self> ⓘ
fn retain(&self) -> DispatchRetained<Self> ⓘ
Source§unsafe fn set_finalizer_f(&self, finalizer: dispatch_function_t)
unsafe fn set_finalizer_f(&self, finalizer: dispatch_function_t)
Source§fn set_finalizer<F>(&self, destructor: F)
fn set_finalizer<F>(&self, destructor: F)
Source§unsafe fn set_target_queue(&self, queue: &DispatchQueue)
unsafe fn set_target_queue(&self, queue: &DispatchQueue)
DispatchQueue of this object. Read more