Struct virtio_device::queue::DescChain
source · pub struct DescChain<'a, 'b, N: DriverNotify> { /* private fields */ }
Expand description
Represents a chain of descriptors in the available ring.
The DescChain
is a thin representation over a virtio descriptor chain. It can either be walked
using its iterator, yielding the readable and writable portions, or it can be returned
to the ring.
Although returning happens automatically when dropped, if data was written into the descriptors
the chain needs to be explicitly returned with set_written
to propagate the
portion that was written.
Implementations§
source§impl<'a, 'b, N: DriverNotify> DescChain<'a, 'b, N>
impl<'a, 'b, N: DriverNotify> DescChain<'a, 'b, N>
sourcepub fn iter(&self) -> DescChainIter<'a, 'b, N> ⓘ
pub fn iter(&self) -> DescChainIter<'a, 'b, N> ⓘ
Iterate over the descriptor chain
See DescChainIter
.
sourcepub fn return_written(self, written: u32)
pub fn return_written(self, written: u32)
Explicitly return a written to chain.
Returns the chain to the used ring, as if the chain was dropped, but also forwards how much of the chain was written to. No validation or manipulation is performed on written amount and it is faithfully passed through. In particular you can claim to have written more bytes than were made available for writing by the chain.