pub struct ScatterGatherList { /* private fields */ }Expand description
Scatter-gather list for zero-copy I/O
Implementations§
Source§impl ScatterGatherList
impl ScatterGatherList
Sourcepub fn add_segment(&mut self, addr: u64, length: usize)
pub fn add_segment(&mut self, addr: u64, length: usize)
Add segment
Sourcepub fn total_length(&self) -> usize
pub fn total_length(&self) -> usize
Get total length
Sourcepub fn segments(&self) -> &[ScatterGatherSegment]
pub fn segments(&self) -> &[ScatterGatherSegment]
Get segments
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Number of segments
Sourcepub fn copy_to_buffer(&self, buf: &mut [u8]) -> Result<usize, KernelError>
pub fn copy_to_buffer(&self, buf: &mut [u8]) -> Result<usize, KernelError>
Copy scatter-gather segments to a contiguous output buffer.
Reads from each segment’s physical address (via the kernel’s direct
physical memory mapping) and copies the data sequentially into buf.
Sourcepub fn assemble(&self) -> Result<Vec<u8>, KernelError>
pub fn assemble(&self) -> Result<Vec<u8>, KernelError>
Assemble all scatter-gather segments into a single contiguous Vec.
This is the fallback path when hardware scatter-gather is not available.