Struct vhost_user_backend::VringMutex
source · [−]pub struct VringMutex<M: GuestAddressSpace = GuestMemoryAtomic<GuestMemoryMmap>> { /* private fields */ }
Expand description
A VringState
object protected by Mutex for multi-threading context.
Trait Implementations
sourceimpl<M: Clone + GuestAddressSpace> Clone for VringMutex<M>
impl<M: Clone + GuestAddressSpace> Clone for VringMutex<M>
sourcefn clone(&self) -> VringMutex<M>
fn clone(&self) -> VringMutex<M>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a, M: 'a + GuestAddressSpace> VringStateGuard<'a, M> for VringMutex<M>
impl<'a, M: 'a + GuestAddressSpace> VringStateGuard<'a, M> for VringMutex<M>
type G = MutexGuard<'a, VringState<M>>
type G = MutexGuard<'a, VringState<M>>
Type for guard returned by VringT::get_ref()
.
sourceimpl<'a, M: 'a + GuestAddressSpace> VringStateMutGuard<'a, M> for VringMutex<M>
impl<'a, M: 'a + GuestAddressSpace> VringStateMutGuard<'a, M> for VringMutex<M>
type G = MutexGuard<'a, VringState<M>>
type G = MutexGuard<'a, VringState<M>>
Type for guard returned by VringT::get_mut()
.
sourceimpl<M: 'static + GuestAddressSpace> VringT<M> for VringMutex<M>
impl<M: 'static + GuestAddressSpace> VringT<M> for VringMutex<M>
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn signal_used_queue(&self) -> Result<()>
fn signal_used_queue(&self) -> Result<()>
Notify the vhost-user master that used descriptors have been put into the used queue.
sourcefn enable_notification(&self) -> Result<bool, VirtQueError>
fn enable_notification(&self) -> Result<bool, VirtQueError>
Enable event notification for queue.
sourcefn disable_notification(&self) -> Result<(), VirtQueError>
fn disable_notification(&self) -> Result<(), VirtQueError>
Disable event notification for queue.
sourcefn needs_notification(&self) -> Result<bool, VirtQueError>
fn needs_notification(&self) -> Result<bool, VirtQueError>
Check whether a notification to the guest is needed.
sourcefn set_enabled(&self, enabled: bool)
fn set_enabled(&self, enabled: bool)
Set vring enabled state.
sourcefn set_queue_info(&self, desc_table: u64, avail_ring: u64, used_ring: u64)
fn set_queue_info(&self, desc_table: u64, avail_ring: u64, used_ring: u64)
Set queue addresses for descriptor table, available ring and used ring.
sourcefn queue_next_avail(&self) -> u16
fn queue_next_avail(&self) -> u16
Get queue next avail head.
sourcefn set_queue_next_avail(&self, base: u16)
fn set_queue_next_avail(&self, base: u16)
Set queue next avail head.
sourcefn set_queue_size(&self, num: u16)
fn set_queue_size(&self, num: u16)
Set configured queue size.
sourcefn set_queue_event_idx(&self, enabled: bool)
fn set_queue_event_idx(&self, enabled: bool)
Enable/disable queue event index feature.
sourcefn set_queue_ready(&self, ready: bool)
fn set_queue_ready(&self, ready: bool)
Set queue enabled state.
Auto Trait Implementations
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
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