with_iovec_segments

Function with_iovec_segments 

Source
pub fn with_iovec_segments<B: Buffer + ?Sized, I: Iovec, T>(
    data: &mut B,
    f: impl FnOnce(&mut [I]) -> Result<T, Errno>,
) -> Option<Result<T, Errno>>
Expand description

Attempts to perform some I/O with the iovec segments of Buffer.

Returns None if the I/O can not be performed with iovecs (when unified aspaces is disabled or the Buffer does not support I/O on its segments directly).

Each segment is safe to read from (if B is an InputBuffer) or write to (if B is an OutputBuffer) without causing undefined behaviour.