Function iovec::unix::as_os_slice [−][src]
pub fn as_os_slice<'a>(iov: &'a [&IoVec]) -> &'a [iovec]ⓘ
Convert a slice of IoVec
refs to a slice of libc::iovec
.
The return value can be passed to writev
bindings.
Examples
use iovec::IoVec; use iovec::unix; let a = b"hello".to_vec(); let b = b"world".to_vec(); let bufs: &[&IoVec] = &[a[..].into(), b[..].into()]; let os_bufs = unix::as_os_slice(bufs); // Use the `os_bufs` slice with `writev`.