Struct vhost_user_backend::VringState
source · [−]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
sourceimpl<M: GuestAddressSpace> VringState<M>
impl<M: GuestAddressSpace> VringState<M>
sourcepub fn get_queue(&self) -> &Queue<M>
pub fn get_queue(&self) -> &Queue<M>
Get an immutable reference to the underlying raw Queue
object.
sourcepub fn get_queue_mut(&mut self) -> &mut Queue<M>
pub fn get_queue_mut(&mut self) -> &mut Queue<M>
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 master 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
)
pub fn set_queue_info(
&mut self,
desc_table: u64,
avail_ring: u64,
used_ring: u64
)
Set queue addresses for descriptor table, available ring and used ring.
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more