pub struct DriverChain { /* private fields */ }Expand description
Driver-owned descriptor chain and buffers.
Construction allocates metadata proportional only to the caller-provided descriptor vector. Queue publication, completion, and reset do not allocate or copy payload bytes.
Implementations§
Source§impl DriverChain
impl DriverChain
Sourcepub fn direct(descriptors: Vec<Descriptor>) -> Result<Self, ChainBuildError>
pub fn direct(descriptors: Vec<Descriptor>) -> Result<Self, ChainBuildError>
Construct a valid direct chain linked in vector order.
Sourcepub fn raw(
descriptors: Vec<Descriptor>,
head: u16,
) -> Result<Self, ChainBuildError>
pub fn raw( descriptors: Vec<Descriptor>, head: u16, ) -> Result<Self, ChainBuildError>
Construct a raw descriptor table for deterministic malformed-chain injection.
next values are local indices in descriptors. Structural errors are retained and later
exposed by SplitDeviceChain::io when the chain is injected into a queue.
Sourcepub fn descriptor_count(&self) -> u16
pub fn descriptor_count(&self) -> u16
Number of descriptor-table entries owned by this chain.
Sourcepub fn validation(&self) -> Result<ChainLayout, MalformedChain>
pub fn validation(&self) -> Result<ChainLayout, MalformedChain>
Validate descriptor topology independently of a queue’s configured chain limit.
Sourcepub fn read_descriptor(
&self,
index: u16,
offset: u64,
target: &mut [u8],
) -> Result<(), ByteAccessError>
pub fn read_descriptor( &self, index: u16, offset: u64, target: &mut [u8], ) -> Result<(), ByteAccessError>
Read bytes from one local descriptor after the queue returns ownership.
Sourcepub fn write_descriptor(
&self,
index: u16,
offset: u64,
source: &[u8],
) -> Result<(), ByteAccessError>
pub fn write_descriptor( &self, index: u16, offset: u64, source: &[u8], ) -> Result<(), ByteAccessError>
Write bytes into one local descriptor while the driver owns the chain.