Crate twizzler_queue

source ·
Expand description

Provides a duplex send/completion queue, where each direction is multiple-producer/single-consumer.

The core queue abstraction is built around two subqueues, each providing an MPSC interface. These subqueues are stored in a single object, and so the verbs to interact with the two subqueues are different.

Generally a queue is thought of as providing a connection between a sender and a receiver, where the sender sends requests to the receiver, and the receiver indications completion of requests. Hence, one subqueue is the sending queue and the other is the completion queue. The subqueue implementation is provided by the twizzler-queue-raw crate. This crate connects that crate to the object system of Twizzler.

The queues also provide hooks for asynchrony, allowing a given call to be non-blocking, and methods to hook into for async executors to wait on events on a queue.

Each subqueue sends a type T across the queue via byte-level copy. Internally, these objects are held in a circular buffer with a maximum length specified on queue creation.


  • A receiver-side async-enabled queue abstraction.
  • A single queue, holding two subqueues (sending and completion). Objects of type S are sent across the sending queue, and completions of type C are sent back.
  • The base info structure stored in a Twizzler queue object. Used to open Twizzler queue objects and create a [Queue].
  • An async-supported sending-half of a Queue. This is to support systems that want to asynchronously send items to a receiver, under the assumption that the receiver sends completions to indicate that a request has been finished, and that the send ID can be reused.
  • Flags to control how queue receive works.
  • Flags to control how queue submission works.


  • Possible errors for submitting to a queue.