Expand description
#![no_std]-friendly wrappers over the std::io::IoSlice and std::io::IoSliceMut, which
are shared slices and exclusive slices, respectively, and ABI-compatible with system types for
I/O vectors.
Internally, the struct will store the following based on crate features:
std- wrappingstd::io::IoSlicedirectly, with accessors for it as well as conversion functions and From impls.libc(and#[cfg(unix)]) - wrappinglibc::iovecdirectly on platforms that support it. A marker is also stored, to safely wrap the raw pointer, and forcing usage of this API to follow the borrow checker rules.- (none) - wrapping a regular slice, that may not have the same ABI guarantees as the types from std or libc have.
IoSlice will however implement AsRef<[u8]>, Borrow<[u8]>, and Deref<Target = [u8]>
regardless of the features used, so long as the slice is marked as initialized.
Modules§
Structs§
- Allocation
Error - An error that may occur if allocating an I/O box fails.
- IoBox
- An owned chunk of memory, that is ABI-compatible with
libc::iovecorWSABUF, depending on the platform and Cargo features used. - IoSlice
- A
#![no_std]-friendly wrapper over thestd::io::IoSliceMut. - IoSlice
Mut - A
#![no_std]-friendly wrapper over thestd::io::IoSliceMut.
Traits§
- Cast
Slice - A trait for casting slices of different types to and from each other, provided that they have the same memory layout.
- Cast
Slice Mut - A trait for casting slices of different types to and from each other, mutably, provided that they have the same memory layout.