pub unsafe trait DispatchObject {
// Provided methods
fn retain(&self) -> DispatchRetained<Self> ⓘ { ... }
fn context(&self) -> *mut c_void { ... }
unsafe fn set_context(&self, context: *mut c_void) { ... }
unsafe fn set_finalizer_f(&self, finalizer: dispatch_function_t) { ... }
fn set_finalizer<F>(&self, destructor: F)
where F: Send + FnOnce() { ... }
unsafe fn set_target_queue(&self, queue: &DispatchQueue) { ... }
unsafe fn set_qos_class_floor(
&self,
qos_class: DispatchQoS,
relative_priority: i32,
) -> Result<(), QualityOfServiceClassFloorError> { ... }
fn activate(&self) { ... }
fn suspend(&self) { ... }
fn resume(&self) { ... }
}
Expand description
Types that represent dispatch objects.
§Safety
The object must represent a dispatch object, and be usable in
dispatch_retain
/ dispatch_release
.
Provided Methods§
Sourcefn retain(&self) -> DispatchRetained<Self> ⓘ
fn retain(&self) -> DispatchRetained<Self> ⓘ
Increment the reference count of the object.
This extends the duration in which the object is alive by detaching it from the lifetime information carried by the reference.
Sourceunsafe fn set_context(&self, context: *mut c_void)
unsafe fn set_context(&self, context: *mut c_void)
Sourceunsafe fn set_finalizer_f(&self, finalizer: dispatch_function_t)
unsafe fn set_finalizer_f(&self, finalizer: dispatch_function_t)
Sourcefn set_finalizer<F>(&self, destructor: F)
fn set_finalizer<F>(&self, destructor: F)
Set the finalizer function for the object.
Sourceunsafe fn set_target_queue(&self, queue: &DispatchQueue)
unsafe fn set_target_queue(&self, queue: &DispatchQueue)
Set the target DispatchQueue
of this object.
§Aborts
Aborts if the object has been activated.
§Safety
- There must not be a cycle in the hierarchy of queues.
Sourceunsafe fn set_qos_class_floor(
&self,
qos_class: DispatchQoS,
relative_priority: i32,
) -> Result<(), QualityOfServiceClassFloorError>
unsafe fn set_qos_class_floor( &self, qos_class: DispatchQoS, relative_priority: i32, ) -> Result<(), QualityOfServiceClassFloorError>
Set the QOS class floor on a dispatch queue, source or workloop.
§Safety
- DispatchObject should be a queue or queue source.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.