pub struct CMSimpleQueue { /* private fields */ }CMSimpleQueue only.Expand description
A reference to a CMSimpleQueue, a CF object that implements a simple lockless queue of (void *) elements.
See also Apple’s documentation
Implementations§
Source§impl CMSimpleQueue
impl CMSimpleQueue
Sourcepub unsafe fn create(
allocator: Option<&CFAllocator>,
capacity: i32,
queue_out: NonNull<*mut CMSimpleQueue>,
) -> i32
pub unsafe fn create( allocator: Option<&CFAllocator>, capacity: i32, queue_out: NonNull<*mut CMSimpleQueue>, ) -> i32
Creates a CMSimpleQueue.
On return, the caller owns the returned CMSimpleQueue, and must release it when done with it.
Returns: Returns noErr if the call succeeds. Returns kCMSimpleQueueError_ParameterOutOfRange if capacity is negative.
§Safety
queue_out must be a valid pointer.
Sourcepub unsafe fn enqueue(&self, element: NonNull<c_void>) -> i32
pub unsafe fn enqueue(&self, element: NonNull<c_void>) -> i32
Enqueues an element on the queue.
If the queue is full, this operation will fail.
Returns: Returns noErr if the call succeeds, kCMSimpleQueueError_QueueIsFull if the queue is full.
§Safety
element must be a valid pointer.
Sourcepub unsafe fn dequeue(&self) -> *const c_void
pub unsafe fn dequeue(&self) -> *const c_void
Dequeues an element from the queue.
If the queue is empty, NULL will be returned.
Returns: The dequeued element. NULL if the queue was empty, or if there was some other error.
Sourcepub unsafe fn head(&self) -> *const c_void
pub unsafe fn head(&self) -> *const c_void
Returns the element at the head of the queue.
If the queue is empty, NULL will be returned.
Returns: The head element. NULL if the queue was empty, or if there was some other error.
Sourcepub unsafe fn reset(&self) -> i32
pub unsafe fn reset(&self) -> i32
Resets the queue.
This function resets the queue to its empty state; all values in the queue prior to reset are lost. Note that CMSimpleQueueReset is not synchronized in any way, so the reader thread and writer thread must be held off by the client during this operation.
Returns: Returns noErr if the call succeeds.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Available on crate feature CMAttachment only.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
CMAttachment only.Attempt to downcast the type to that of type T.
This is the reference-variant. Use CFRetained::downcast if you
want to convert a retained type. See also ConcreteType for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
Available on crate feature CMAttachment only.
pub fn retain_count(&self) -> usize
CMAttachment only.Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CMSimpleQueue
impl AsRef<AnyObject> for CMSimpleQueue
Source§impl AsRef<CFType> for CMSimpleQueue
impl AsRef<CFType> for CMSimpleQueue
Source§impl AsRef<CMSimpleQueue> for CMSimpleQueue
impl AsRef<CMSimpleQueue> for CMSimpleQueue
Source§impl Borrow<AnyObject> for CMSimpleQueue
impl Borrow<AnyObject> for CMSimpleQueue
Source§impl Borrow<CFType> for CMSimpleQueue
impl Borrow<CFType> for CMSimpleQueue
Source§impl ConcreteType for CMSimpleQueue
impl ConcreteType for CMSimpleQueue
Source§impl Debug for CMSimpleQueue
impl Debug for CMSimpleQueue
Source§impl Deref for CMSimpleQueue
impl Deref for CMSimpleQueue
Source§impl Hash for CMSimpleQueue
impl Hash for CMSimpleQueue
Source§impl Message for CMSimpleQueue
impl Message for CMSimpleQueue
Source§impl PartialEq for CMSimpleQueue
impl PartialEq for CMSimpleQueue
Source§impl RefEncode for CMSimpleQueue
impl RefEncode for CMSimpleQueue
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for CMSimpleQueue
impl Type for CMSimpleQueue
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more