pub struct QueueState {
    pub max_size: u16,
    pub next_avail: u16,
    pub next_used: u16,
    pub event_idx_enabled: bool,
    pub size: u16,
    pub ready: bool,
    pub desc_table: u64,
    pub avail_ring: u64,
    pub used_ring: u64,
}
Expand description

Representation of the Queue state.

The QueueState represents the pure state of the queue without tracking any implementation details of the queue. The goal with this design is to minimize the changes required to the state, and thus the required transitions between states when upgrading or downgrading.

In practice this means that the QueueState consists solely of POD (Plain Old Data).

As this structure has all the fields public it is consider to be untrusted. A validated queue can be created from the state by calling the associated try_from function.

Fields

max_size: u16

The maximum size in elements offered by the device.

next_avail: u16

Tail position of the available ring.

next_used: u16

Head position of the used ring.

event_idx_enabled: bool

VIRTIO_F_RING_EVENT_IDX negotiated.

size: u16

The queue size in elements the driver selected.

ready: bool

Indicates if the queue is finished with configuration.

desc_table: u64

Guest physical address of the descriptor table.

avail_ring: u64

Guest physical address of the available ring.

used_ring: u64

Guest physical address of the used ring.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.

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.