Struct std::sync::mpsc::mpsc_queue::Queue[][src]

pub struct Queue<T> {
    head: AtomicPtr<Node<T>>,
    tail: UnsafeCell<*mut Node<T>>,
}
Expand description

The multi-producer single-consumer structure. This is not cloneable, but it may be safely shared so long as it is guaranteed that there is only one popper at a time (many pushers are allowed).

Fields

head: AtomicPtr<Node<T>>tail: UnsafeCell<*mut Node<T>>

Implementations

Creates a new queue that is safe to share among multiple producers and one consumer.

Pushes a new value onto this queue.

Pops some data from this queue.

Note that the current implementation means that this function cannot return Option<T>. It is possible for this queue to be in an inconsistent state where many pushes have succeeded and completely finished, but pops cannot return Some(t). This inconsistent state happens when a pusher is pre-empted at an inopportune moment.

This inconsistent state means that this queue does indeed have data, but it does not currently have access to it at this time.

Trait Implementations

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

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.