pub struct VringMutex<M: GuestAddressSpace = GuestMemoryAtomic<GuestMemoryMmap>> { /* private fields */ }
Expand description
A VringState
object protected by Mutex for multi-threading context.
Trait Implementations§
Source§impl<M: Clone + GuestAddressSpace> Clone for VringMutex<M>
impl<M: Clone + GuestAddressSpace> Clone for VringMutex<M>
Source§fn clone(&self) -> VringMutex<M>
fn clone(&self) -> VringMutex<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, M: 'a + GuestAddressSpace> VringStateGuard<'a, M> for VringMutex<M>
impl<'a, M: 'a + GuestAddressSpace> VringStateGuard<'a, M> for VringMutex<M>
Source§type G = MutexGuard<'a, VringState<M>>
type G = MutexGuard<'a, VringState<M>>
Type for guard returned by
VringT::get_ref()
.Source§impl<'a, M: 'a + GuestAddressSpace> VringStateMutGuard<'a, M> for VringMutex<M>
impl<'a, M: 'a + GuestAddressSpace> VringStateMutGuard<'a, M> for VringMutex<M>
Source§type G = MutexGuard<'a, VringState<M>>
type G = MutexGuard<'a, VringState<M>>
Type for guard returned by
VringT::get_mut()
.Source§impl<M: 'static + GuestAddressSpace> VringT<M> for VringMutex<M>
impl<M: 'static + GuestAddressSpace> VringT<M> for VringMutex<M>
Source§fn new(mem: M, max_queue_size: u16) -> Result<Self, VirtQueError>
fn new(mem: M, max_queue_size: u16) -> Result<Self, VirtQueError>
Create a new instance of Vring.
Source§fn get_ref(&self) -> <Self as VringStateGuard<'_, M>>::G
fn get_ref(&self) -> <Self as VringStateGuard<'_, M>>::G
Get an immutable reference to the kick event fd.
Source§fn get_mut(&self) -> <Self as VringStateMutGuard<'_, M>>::G
fn get_mut(&self) -> <Self as VringStateMutGuard<'_, M>>::G
Get a mutable reference to the kick event fd.
Source§fn add_used(&self, desc_index: u16, len: u32) -> Result<(), VirtQueError>
fn add_used(&self, desc_index: u16, len: u32) -> Result<(), VirtQueError>
Add an used descriptor into the used queue.
Source§fn signal_used_queue(&self) -> Result<()>
fn signal_used_queue(&self) -> Result<()>
Notify the vhost-user frontend that used descriptors have been put into the used queue.
Source§fn enable_notification(&self) -> Result<bool, VirtQueError>
fn enable_notification(&self) -> Result<bool, VirtQueError>
Enable event notification for queue.
Source§fn disable_notification(&self) -> Result<(), VirtQueError>
fn disable_notification(&self) -> Result<(), VirtQueError>
Disable event notification for queue.
Source§fn needs_notification(&self) -> Result<bool, VirtQueError>
fn needs_notification(&self) -> Result<bool, VirtQueError>
Check whether a notification to the guest is needed.
Source§fn set_enabled(&self, enabled: bool)
fn set_enabled(&self, enabled: bool)
Set vring enabled state.
Source§fn set_queue_info(
&self,
desc_table: u64,
avail_ring: u64,
used_ring: u64,
) -> Result<(), VirtQueError>
fn set_queue_info( &self, desc_table: u64, avail_ring: u64, used_ring: u64, ) -> Result<(), VirtQueError>
Set queue addresses for descriptor table, available ring and used ring.
Source§fn queue_next_avail(&self) -> u16
fn queue_next_avail(&self) -> u16
Get queue next avail head.
Source§fn set_queue_next_avail(&self, base: u16)
fn set_queue_next_avail(&self, base: u16)
Set queue next avail head.
Source§fn set_queue_next_used(&self, idx: u16)
fn set_queue_next_used(&self, idx: u16)
Set queue next used head.
Source§fn queue_used_idx(&self) -> Result<u16, VirtQueError>
fn queue_used_idx(&self) -> Result<u16, VirtQueError>
Get queue next used head index from the guest memory.
Source§fn set_queue_size(&self, num: u16)
fn set_queue_size(&self, num: u16)
Set configured queue size.
Source§fn set_queue_event_idx(&self, enabled: bool)
fn set_queue_event_idx(&self, enabled: bool)
Enable/disable queue event index feature.
Source§fn set_queue_ready(&self, ready: bool)
fn set_queue_ready(&self, ready: bool)
Set queue enabled state.
Auto Trait Implementations§
impl<M> Freeze for VringMutex<M>
impl<M> RefUnwindSafe for VringMutex<M>
impl<M> Send for VringMutex<M>where
M: Send,
impl<M> Sync for VringMutex<M>where
M: Send,
impl<M> Unpin for VringMutex<M>
impl<M> UnwindSafe for VringMutex<M>
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