[−][src]Struct iovec::IoVec
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.
Examples
use iovec::IoVec; let mut data = vec![]; data.extend_from_slice(b"hello"); let iovec: &IoVec = data.as_slice().into(); assert_eq!(&iovec[..], &b"hello"[..]);
Panics
Attempting to convert a zero-length slice or a slice longer than
MAX_LENGTH
to an IoVec
will result in a panic.
Methods
impl IoVec
[src]
impl IoVec
pub fn from_bytes(slice: &[u8]) -> Option<&IoVec>
[src]
pub fn from_bytes(slice: &[u8]) -> Option<&IoVec>
pub fn from_bytes_mut(slice: &mut [u8]) -> Option<&mut IoVec>
[src]
pub fn from_bytes_mut(slice: &mut [u8]) -> Option<&mut IoVec>
Trait Implementations
impl Deref for IoVec
[src]
impl Deref for IoVec
type Target = [u8]
The resulting type after dereferencing.
fn deref(&self) -> &[u8]
[src]
fn deref(&self) -> &[u8]
Dereferences the value.
impl DerefMut for IoVec
[src]
impl DerefMut for IoVec
Auto Trait Implementations
Blanket Implementations
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more