Skip to main content

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).

NOTE: The segments can only be accessed using user copy routines or Zircon system calls (see the comment above for `peek_each_segment). The pointers returned are not valid for any non-zero sized access (see Rust’s std::ptr documentation).