pub struct VirtioQueueCallbackWork {
pub payload: Vec<VirtioQueuePayload>,
/* private fields */
}Expand description
A descriptor chain popped from a VirtioQueue.
The device must call VirtioQueue::complete exactly once to post a
completion to the guest’s used ring. Dropping without completing is a bug
and will not automatically post a completion.
Fields§
§payload: Vec<VirtioQueuePayload>Implementations§
Source§impl VirtioQueueCallbackWork
impl VirtioQueueCallbackWork
pub fn descriptor_index(&self) -> u16
Sourcepub fn into_completion(self) -> QueueCompletion
pub fn into_completion(self) -> QueueCompletion
Discards the payload buffer descriptors and returns the lightweight
QueueCompletion token, which carries only the state
VirtioQueue::complete_prepared needs to publish the used ring entry.
Use this to buffer a completion (e.g. for in-order publication) without retaining the full payload.
pub fn get_payload_length(&self, writeable: bool) -> u64
pub fn read( &self, mem: &GuestMemory, target: &mut [u8], ) -> Result<usize, GuestMemoryError>
Sourcepub fn read_at_offset(
&self,
offset: u64,
mem: &GuestMemory,
target: &mut [u8],
) -> Result<usize, GuestMemoryError>
pub fn read_at_offset( &self, offset: u64, mem: &GuestMemory, target: &mut [u8], ) -> Result<usize, GuestMemoryError>
Read readable payload into target, skipping the first offset
bytes of readable data.
pub fn write_at_offset( &self, offset: u64, mem: &GuestMemory, source: &[u8], ) -> Result<(), VirtioWriteError>
pub fn write( &self, mem: &GuestMemory, source: &[u8], ) -> Result<(), VirtioWriteError>
Auto Trait Implementations§
impl Freeze for VirtioQueueCallbackWork
impl RefUnwindSafe for VirtioQueueCallbackWork
impl Send for VirtioQueueCallbackWork
impl Sync for VirtioQueueCallbackWork
impl Unpin for VirtioQueueCallbackWork
impl UnsafeUnpin for VirtioQueueCallbackWork
impl UnwindSafe for VirtioQueueCallbackWork
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