Struct DispatchQueue
pub struct DispatchQueue { /* private fields */ }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§
§impl DispatchQueue
impl DispatchQueue
pub fn new(label: &str, qos: DispatchQoS) -> DispatchQueue
pub fn new(label: &str, qos: DispatchQoS) -> DispatchQueue
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) -> DispatchQueue
pub fn main() -> DispatchQueue
pub fn global(qos: DispatchQoS) -> DispatchQueue
pub 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§
§impl Clone for DispatchQueue
impl Clone for DispatchQueue
§fn clone(&self) -> DispatchQueue
fn clone(&self) -> DispatchQueue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for DispatchQueue
impl Debug for DispatchQueue
§impl Display for DispatchQueue
impl Display for DispatchQueue
§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