Skip to main content

DriverQueue

Trait DriverQueue 

Source
pub trait DriverQueue: QueuePort {
    type Chain;
    type Reclaimed: IntoIterator<Item = ReclaimedChain<Self::Chain>>;
    type Error;

    // Required methods
    fn publish(
        &mut self,
        chain: Self::Chain,
    ) -> Result<PublishedChain, PublishError<Self::Chain, Self::Error>>;
    fn pop_used(
        &mut self,
    ) -> Result<Option<UsedChain<Self::Chain>>, QueueError<Self::Error>>;
    fn disable_used_notifications(
        &mut self,
    ) -> Result<(), QueueError<Self::Error>>;
    fn enable_used_notifications(
        &mut self,
    ) -> Result<NotificationRecheck, QueueError<Self::Error>>;
    fn reset(
        &mut self,
        next_epoch: QueueEpoch,
    ) -> Result<Self::Reclaimed, QueueError<Self::Error>>;
}
Expand description

Driver-side descriptor publication and used-ring consumption.

A successful DriverQueue::publish transfers exclusive chain ownership to the queue until DriverQueue::pop_used or DriverQueue::reset returns it. Implementations must publish all descriptor contents and the available index before returning a notification decision. A successful used pop is an acquire boundary for response bytes written before device completion.

Required Associated Types§

Source

type Chain

Driver-owned command and descriptor resources.

Source

type Reclaimed: IntoIterator<Item = ReclaimedChain<Self::Chain>>

Owned collection of chains reclaimed by reset.

Source

type Error

Concrete transport failure.

Required Methods§

Source

fn publish( &mut self, chain: Self::Chain, ) -> Result<PublishedChain, PublishError<Self::Chain, Self::Error>>

Publish a complete chain or return it unchanged on pre-publication backpressure.

This operation must not block or allocate. Success is a release boundary for descriptor and request writes. Failure must not transfer ownership or expose a partial chain to the device.

Source

fn pop_used( &mut self, ) -> Result<Option<UsedChain<Self::Chain>>, QueueError<Self::Error>>

Consume one used entry and recover the corresponding driver chain.

This operation must not block or allocate. It is an acquire boundary for the used entry and response bytes. Independent completions may be returned out of publication order.

Source

fn disable_used_notifications(&mut self) -> Result<(), QueueError<Self::Error>>

Disable used-ring notifications before draining completions.

This operation must not block or allocate.

Source

fn enable_used_notifications( &mut self, ) -> Result<NotificationRecheck, QueueError<Self::Error>>

Enable used-ring notifications and atomically recheck for missed completions.

This operation must not block or allocate. WorkPending requires the caller to continue draining rather than sleep.

Source

fn reset( &mut self, next_epoch: QueueEpoch, ) -> Result<Self::Reclaimed, QueueError<Self::Error>>

Invalidate the old epoch and recover every chain still owned by the queue.

This operation must not block or allocate. It may move existing queue-owned storage into the returned collection. next_epoch must be greater than the current epoch. No old used entry or response write may become visible after success.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§