pub struct WritableChain<M: MemOps> { /* private fields */ }Expand description
Implementations§
Source§impl<M: MemOps> WritableChain<M>
impl<M: MemOps> WritableChain<M>
Sourcepub fn desc_count(&self) -> usize
pub fn desc_count(&self) -> usize
Number of writable descriptors in this chain.
Sourcepub fn write(&mut self, buf: &[u8]) -> Result<usize, VirtqError>
pub fn write(&mut self, buf: &[u8]) -> Result<usize, VirtqError>
Write bytes into writable buffers, returning how many were written.
Appends at the current write position. If buf is larger than the
remaining capacity, writes as many bytes as will fit (partial write).
Segmentation is intentionally hidden; host-side writes must go through
MemOps::write. If a later memory write fails, the cursor and written
length retain any earlier chunks written by the same call.
§Errors
VirtqError::MemoryWriteError- underlying MemOps write failed
Sourcepub fn write_all(&mut self, buf: &[u8]) -> Result<&mut Self, VirtqError>
pub fn write_all(&mut self, buf: &[u8]) -> Result<&mut Self, VirtqError>
Write the entire buffer or return an error.
§Errors
VirtqError::ReplyTooLarge- buf exceeds remaining capacityVirtqError::MemoryWriteError- underlying MemOps write failed
Trait Implementations§
Source§impl<M: MemOps> From<WritableChain<M>> for ReplyChain<M>
impl<M: MemOps> From<WritableChain<M>> for ReplyChain<M>
Source§fn from(wc: WritableChain<M>) -> Self
fn from(wc: WritableChain<M>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<M> Freeze for WritableChain<M>where
ChainState<M>: Freeze,
impl<M> RefUnwindSafe for WritableChain<M>where
ChainState<M>: RefUnwindSafe,
impl<M> Send for WritableChain<M>where
ChainState<M>: Send,
impl<M> Sync for WritableChain<M>where
ChainState<M>: Sync,
impl<M> Unpin for WritableChain<M>where
ChainState<M>: Unpin,
impl<M> UnsafeUnpin for WritableChain<M>where
ChainState<M>: UnsafeUnpin,
impl<M> UnwindSafe for WritableChain<M>where
ChainState<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