pub struct VringState<M: GuestAddressSpace = GuestMemoryAtomic<GuestMemoryMmap>> { /* private fields */ }
Expand description
Struct to maintain raw state information for a vhost-user queue.
This struct maintains all information of a virito queue, and could be used as an VringT
object for single-threaded context.
Implementations§
Source§impl<M: GuestAddressSpace> VringState<M>
impl<M: GuestAddressSpace> VringState<M>
Sourcepub fn get_queue(&self) -> &Queue
pub fn get_queue(&self) -> &Queue
Get an immutable reference to the underlying raw Queue
object.
Sourcepub fn get_queue_mut(&mut self) -> &mut Queue
pub fn get_queue_mut(&mut self) -> &mut Queue
Get a mutable reference to the underlying raw Queue
object.
Sourcepub fn add_used(
&mut self,
desc_index: u16,
len: u32,
) -> Result<(), VirtQueError>
pub fn add_used( &mut self, desc_index: u16, len: u32, ) -> Result<(), VirtQueError>
Add an used descriptor into the used queue.
Sourcepub fn signal_used_queue(&self) -> Result<()>
pub fn signal_used_queue(&self) -> Result<()>
Notify the vhost-user frontend that used descriptors have been put into the used queue.
Sourcepub fn enable_notification(&mut self) -> Result<bool, VirtQueError>
pub fn enable_notification(&mut self) -> Result<bool, VirtQueError>
Enable event notification for queue.
Sourcepub fn disable_notification(&mut self) -> Result<(), VirtQueError>
pub fn disable_notification(&mut self) -> Result<(), VirtQueError>
Disable event notification for queue.
Sourcepub fn needs_notification(&mut self) -> Result<bool, VirtQueError>
pub fn needs_notification(&mut self) -> Result<bool, VirtQueError>
Check whether a notification to the guest is needed.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Set vring enabled state.
Sourcepub fn set_queue_info(
&mut self,
desc_table: u64,
avail_ring: u64,
used_ring: u64,
) -> Result<(), VirtQueError>
pub fn set_queue_info( &mut self, desc_table: u64, avail_ring: u64, used_ring: u64, ) -> Result<(), VirtQueError>
Set queue addresses for descriptor table, available ring and used ring.
Auto Trait Implementations§
impl<M> Freeze for VringState<M>where
M: Freeze,
impl<M> RefUnwindSafe for VringState<M>where
M: RefUnwindSafe,
impl<M> Send for VringState<M>where
M: Send,
impl<M> Sync for VringState<M>where
M: Sync,
impl<M> Unpin for VringState<M>where
M: Unpin,
impl<M> UnwindSafe for VringState<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more