[][src]Struct iovec::IoVec

pub struct IoVec { /* fields omitted */ }

A specialized byte slice type for performing vectored I/O operations.

On all systems, the types needed to perform vectored I/O systems have the same size as Rust's slice. However, the layout is not necessarily the same. IoVec provides a portable compatibility layer.

The IoVec behaves like a Rust slice, providing the same functions. It also provides conversion functions to and from the OS specific vectored types.


use iovec::IoVec;

let mut data = vec![];

let iovec: &IoVec = data.as_slice().into();

assert_eq!(&iovec[..], &b"hello"[..]);


Attempting to convert a zero-length slice or a slice longer than MAX_LENGTH to an IoVec will result in a panic.


impl IoVec[src]

pub fn from_bytes(slice: &[u8]) -> Option<&IoVec>[src]

pub fn from_bytes_mut(slice: &mut [u8]) -> Option<&mut IoVec>[src]

Trait Implementations

impl Deref for IoVec[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for IoVec[src]

Auto Trait Implementations

impl Send for IoVec

impl Sync for IoVec

impl Unpin for IoVec

impl UnwindSafe for IoVec

impl RefUnwindSafe for IoVec

Blanket Implementations

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized