pub type CommandRingController = RingBufferController<CommandRingTrbHandler>;

Aliased Type§

struct CommandRingController {
    name: String,
    state: Mutex<RingBufferState>,
    stop_callback: Mutex<Vec<RingBufferStopCallback>>,
    ring_buffer: Mutex<RingBuffer>,
    handler: Mutex<CommandRingTrbHandler>,
    event_loop: Arc<EventLoop>,
    event: Event,
}

Fields§

§name: String§state: Mutex<RingBufferState>§stop_callback: Mutex<Vec<RingBufferStopCallback>>§ring_buffer: Mutex<RingBuffer>§handler: Mutex<CommandRingTrbHandler>§event_loop: Arc<EventLoop>§event: Event

Implementations

source§

impl RingBufferController<CommandRingTrbHandler>

source§

impl<T> RingBufferController<T>
where T: 'static + TransferDescriptorHandler + Send,

source

pub fn new_with_handler( name: String, mem: GuestMemory, event_loop: Arc<EventLoop>, handler: T ) -> Result<Arc<RingBufferController<T>>, Error>

Create a ring buffer controller and add it to event loop.

source

fn lock_ring_buffer(&self) -> MutexGuard<'_, RingBuffer>

source

pub fn get_dequeue_pointer(&self) -> GuestAddress

Get dequeue pointer of the internal ring buffer.

source

pub fn set_dequeue_pointer(&self, ptr: GuestAddress)

Set dequeue pointer of the internal ring buffer.

source

pub fn get_consumer_cycle_state(&self) -> bool

Get consumer cycle state.

source

pub fn set_consumer_cycle_state(&self, state: bool)

Set consumer cycle state.

source

pub fn start(&self)

Start the ring buffer.

source

pub fn stop(&self, callback: RingBufferStopCallback)

Stop the ring buffer asynchronously.

Trait Implementations

source§

impl<T: 'static + TransferDescriptorHandler> Display for RingBufferController<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> EventHandler for RingBufferController<T>
where T: 'static + TransferDescriptorHandler + Send,

source§

fn on_event(&self) -> Result<()>

source§

impl<T> Drop for RingBufferController<T>
where T: 'static + TransferDescriptorHandler,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more