Function iovec::unix::as_os_slice_mut[][src]

pub fn as_os_slice_mut<'a>(iov: &'a mut [&mut IoVec]) -> &'a mut [iovec]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]

Convert a mutable slice of IoVec refs to a mutable slice of libc::iovec.

The return value can be passed to readv bindings.

Examples

use iovec::IoVec;
use iovec::unix;

let mut a = [0; 10];
let mut b = [0; 10];

let bufs: &mut [&mut IoVec] = &mut [(&mut a[..]).into(), (&mut b[..]).into()];
let os_bufs = unix::as_os_slice_mut(bufs);

// Use the `os_bufs` slice with `readv`.