pub struct DispatchQueue { /* private fields */ }Available on crate feature
dispatch only.Expand description
A wrapper around GCD DispatchQueue
This allows you to provide a custom dispatch queue for stream output handling instead of using the default queue.
§Example
use apple_cf::dispatch_queue::{DispatchQueue, DispatchQoS};
let queue = DispatchQueue::new("com.myapp.capture", DispatchQoS::UserInteractive);Implementations§
Source§impl DispatchQueue
impl DispatchQueue
Sourcepub fn new(label: &str, qos: DispatchQoS) -> Self
pub fn new(label: &str, qos: DispatchQoS) -> Self
Creates a new dispatch queue with the specified label and QoS
§Arguments
label- A string label for the queue (e.g., “com.myapp.capture”)qos- The quality of service level for the queue
§Examples
use apple_cf::dispatch_queue::{DispatchQueue, DispatchQoS};
let queue = DispatchQueue::new("com.myapp.capture", DispatchQoS::UserInteractive);
// Use the queue with SCStream's add_output_handler_with_queueThe label is truncated at its first NUL byte.
§Panics
Panics if queue creation fails
pub fn concurrent(label: &str, qos: DispatchQoS) -> Self
pub fn main() -> Self
pub fn global(qos: DispatchQoS) -> Self
Sourcepub const fn as_ptr(&self) -> *const c_void
pub const fn as_ptr(&self) -> *const c_void
Returns the raw pointer to the dispatch queue
This is used internally for FFI calls (and for testing)
pub unsafe fn exec_async_f( &self, context: *mut c_void, work: unsafe extern "C" fn(*mut c_void), )
pub unsafe fn exec_after_f( &self, delay: Duration, context: *mut c_void, work: unsafe extern "C" fn(*mut c_void), )
Trait Implementations§
Source§impl Clone for DispatchQueue
impl Clone for DispatchQueue
Source§impl Debug for DispatchQueue
impl Debug for DispatchQueue
Source§impl Display for DispatchQueue
impl Display for DispatchQueue
Source§impl Drop for DispatchQueue
impl Drop for DispatchQueue
impl Send for DispatchQueue
impl Sync for DispatchQueue
Auto Trait Implementations§
impl Freeze for DispatchQueue
impl RefUnwindSafe for DispatchQueue
impl Unpin for DispatchQueue
impl UnsafeUnpin for DispatchQueue
impl UnwindSafe for DispatchQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more