Skip to main content

CommandQueue

Struct CommandQueue 

Source
pub struct CommandQueue(/* private fields */);
Expand description

A queue that organizes the order of command buffer execution.

C++ equivalent: MTL::CommandQueue

You typically create a command queue early in your app’s lifecycle and reuse it throughout the app. Command buffers created from the same queue are guaranteed to execute in the order they are committed.

Implementations§

Source§

impl CommandQueue

Source

pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>

Create a CommandQueue from a raw pointer.

§Safety

The pointer must be a valid Metal command queue object.

Source

pub fn as_raw(&self) -> *mut c_void

Get the raw pointer to the command queue.

Source

pub fn command_buffer(&self) -> Option<CommandBuffer>

Create a new command buffer.

C++ equivalent: CommandBuffer* commandBuffer()

Source

pub fn command_buffer_with_unretained_references(&self) -> Option<CommandBuffer>

Create a new command buffer with an unretained reference.

The returned command buffer is autoreleased and will be deallocated unless you explicitly retain it.

C++ equivalent: CommandBuffer* commandBufferWithUnretainedReferences()

Source

pub unsafe fn command_buffer_with_descriptor_ptr( &self, descriptor: *const c_void, ) -> Option<CommandBuffer>

Create a new command buffer with a descriptor (raw pointer version).

C++ equivalent: CommandBuffer* commandBuffer(const CommandBufferDescriptor*)

§Safety

The descriptor pointer must be valid.

Source

pub fn command_buffer_with_descriptor( &self, descriptor: &CommandBufferDescriptor, ) -> Option<CommandBuffer>

Create a new command buffer with a typed descriptor.

C++ equivalent: CommandBuffer* commandBuffer(const CommandBufferDescriptor*)

Source

pub fn label(&self) -> Option<String>

Get the label for this command queue.

C++ equivalent: NS::String* label() const

Source

pub fn set_label(&self, label: &str)

Set the label for this command queue.

C++ equivalent: void setLabel(const NS::String*)

Source

pub fn device(&self) -> Device

Get the device that created this command queue.

C++ equivalent: Device* device() const

Source

pub fn insert_debug_capture_boundary(&self)

Insert a debug capture boundary.

C++ equivalent: void insertDebugCaptureBoundary()

Source

pub unsafe fn add_residency_set(&self, residency_set: *const c_void)

Add a residency set to the command queue.

C++ equivalent: void addResidencySet(const ResidencySet*)

§Safety

The residency_set pointer must be valid.

Source

pub unsafe fn add_residency_sets( &self, residency_sets: *const *const c_void, count: UInteger, )

Add multiple residency sets to the command queue.

C++ equivalent: void addResidencySets(const ResidencySet* const*, NS::UInteger count)

§Safety

The residency_sets pointer must be valid and point to count valid pointers.

Source

pub unsafe fn remove_residency_set(&self, residency_set: *const c_void)

Remove a residency set from the command queue.

C++ equivalent: void removeResidencySet(const ResidencySet*)

§Safety

The residency_set pointer must be valid.

Source

pub unsafe fn remove_residency_sets( &self, residency_sets: *const *const c_void, count: UInteger, )

Remove multiple residency sets from the command queue.

C++ equivalent: void removeResidencySets(const ResidencySet* const*, NS::UInteger count)

§Safety

The residency_sets pointer must be valid and point to count valid pointers.

Source

pub fn wait_for_event(&self, event: &Event, value: u64)

Wait for an event to reach a specific value.

C++ equivalent: void wait(const MTL::Event* event, uint64_t value)

Source

pub unsafe fn wait_for_drawable(&self, drawable: *const c_void)

Wait for a drawable to become available.

C++ equivalent: void wait(const MTL::Drawable* drawable)

§Safety

The drawable pointer must be valid.

Trait Implementations§

Source§

impl Clone for CommandQueue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CommandQueue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Referencing for CommandQueue

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> usize

Get the retain count of the object. Read more
Source§

impl Send for CommandQueue

Source§

impl Sync for CommandQueue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.