Struct dispatch::Queue

source ·
pub struct Queue { /* private fields */ }
Expand description

A Grand Central Dispatch queue.

For more information, see Apple’s Grand Central Dispatch reference.

Implementations

Returns the serial dispatch Queue associated with the application’s main thread.

Returns a system-defined global concurrent Queue with the specified priority.

Creates a new dispatch Queue.

Creates a new dispatch Queue with the given target queue.

A dispatch queue’s priority is inherited from its target queue. Additionally, if both the queue and its target are serial queues, their blocks will not be invoked concurrently.

Returns the label that was specified for self.

Submits a closure for execution on self and waits until it completes.

Submits a closure for asynchronous execution on self and returns immediately.

After the specified delay, submits a closure for asynchronous execution on self.

After the specified delay, submits a closure for asynchronous execution on self.

Submits a closure to be executed on self the given number of iterations and waits until it completes.

Submits a closure to be executed on self for each element of the provided slice and waits until it completes.

Submits a closure to be executed on self for each element of the provided vector and returns a Vec of the mapped elements.

Submits a closure to be executed on self as a barrier and waits until it completes.

Barriers create synchronization points within a concurrent queue. If self is concurrent, when it encounters a barrier it delays execution of the closure (and any further ones) until all closures submitted before the barrier finish executing. At that point, the barrier closure executes by itself. Upon completion, self resumes its normal execution behavior.

If self is a serial queue or one of the global concurrent queues, this method behaves like the normal sync method.

Submits a closure to be executed on self as a barrier and returns immediately.

Barriers create synchronization points within a concurrent queue. If self is concurrent, when it encounters a barrier it delays execution of the closure (and any further ones) until all closures submitted before the barrier finish executing. At that point, the barrier closure executes by itself. Upon completion, self resumes its normal execution behavior.

If self is a serial queue or one of the global concurrent queues, this method behaves like the normal async method.

Suspends the invocation of blocks on self and returns a SuspendGuard that can be dropped to resume.

The suspension occurs after completion of any blocks running at the time of the call. Invocation does not resume until all SuspendGuards have been dropped.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.