Struct fruity__bbqsrc::dispatch::DispatchSource [−][src]
#[repr(C)]pub struct DispatchSource(_);
Expand description
An object that coordinates the processing of specific low-level system events, such as file-system events, timers, and UNIX signals.
Documentation: Swift | Objective-C
Implementations
pub unsafe fn create(
source_type: &DispatchSourceType,
handle: usize,
mask: usize,
queue: Option<&DispatchQueue>
) -> Arc<Self>
pub unsafe fn create(
source_type: &DispatchSourceType,
handle: usize,
mask: usize,
queue: Option<&DispatchQueue>
) -> Arc<Self>
Creates a new dispatch source to monitor low-level system events.
Dispatch sources are created in a suspended state. After creating the
source and setting any desired attributes (for example, the handler or
the context), your application must call
activate
to begin event delivery.
Important: Event source creation is asynchronous, so be aware of any race conditions with monitored system handles. For example, if a dispatch source is created for a process and that process exits before the source is created, any specified cancellation handler may not be called.
Documentation: Objective-C
Safety
The expectations for the given source type must be upheld.
Returns pending data for this dispatch source.
Documentation: Swift | Objective-C
Merges data into a dispatch source and submits its event handler block to its target queue.
Documentation: Objective-C
Safety
This dispatch source must be of type DispatchSourceType::data_add
or
DispatchSourceType::data_or
.
Returns the mask of events monitored by this dispatch source.
Documentation: Swift | Objective-C
Returns the underlying system handle associated with this dispatch source.
Documentation: Swift | Objective-C
Sets a start time, interval, and leeway value for this dispatch timer source.
Documentation: Objective-C
Safety
This dispatch source must be of type DispatchSourceType::timer
.
Asynchronously cancels this dispatch source, preventing any further invocation of its event handler block.
Documentation: Swift | Objective-C
Returns true
if this dispatch source has been cancelled.
Documentation: Swift | Objective-C
Methods from Deref<Target = DispatchObject>
Activates self
.
Once a dispatch object has been activated, it cannot change its target queue.
See documentation.
Resumes the invocation of block objects on self
.
See documentation.
Suspends the invocation of block objects on self
.
See documentation.
Specifies the dispatch queue on which to perform work associated with
self
.
If this queue has already been activated, then this method will fail.
Important: When setting up target queues, it is a programmer error to create cycles in the dispatch queue hierarchy. In other words, don’t set the target of queue A to queue B and set the target of queue B to queue A.
Documentation: Swift | Objective-C
Safety
The target queue must be expected for this dispatch object. For example, an object may expect to dispatch to the main queue.
Returns the application-defined context of an object.
See documentation.
Associates an application-defined context with the object.
See documentation.
Safety
The object or dependent code may make assumptions about its current context. Callers must be careful to not invalidate any assumptions.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DispatchSource
impl Send for DispatchSource
impl Sync for DispatchSource
impl Unpin for DispatchSource
impl UnwindSafe for DispatchSource