Struct atomic_queue::Queue[][src]

pub struct Queue<T> { /* fields omitted */ }
Expand description

Atomic queue cloned from https://github.com/max0x7ba/atomic_queue

Should be:

  • Lock-free

Any type can be pushed into the queue, but it’s recommended to use some sort of smart pointer that can be free-ed outside of the critical path.

Uses unsafe internally.

Implementations

Create a queue with a certain capacity. Writes will fail when the queue is full.

Push an element into the queue and return true on success.

false will be returned if the queue is full. If there’s contention this operation will wait until it’s able to claim a slot in the queue.

Pop an element from the queue and return true on success.

false will be returned if the queue is empty. If there’s contention this operation will wait until it’s able to claim a slot in the queue.

Pop an element from the queue without checking if it’s empty.

Push an element into the queue without checking if it’s full.

True if the queue is empty.

Get the length of the queue.

Trait Implementations

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

Performs the conversion.

Performs the conversion.

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.