Struct cros_async::mem::VecIoWrapper
source · pub struct VecIoWrapper {
inner: Box<[u8]>,
}
Expand description
Wrapper to be used for passing a Vec in as backing memory for asynchronous operations. The
wrapper owns a Vec according to the borrow checker. It is loaning this vec out to the kernel(or
other modifiers) through the BackingMemory
trait. This allows multiple modifiers of the array
in the Vec
while this struct is alive. The data in the Vec is loaned to the kernel not the
data structure itself, the length, capacity, and pointer to memory cannot be modified.
To ensure that those operations can be done safely, no access is allowed to the Vec
’s memory
starting at the time that VecIoWrapper
is constructed until the time it is turned back in to a
Vec
using to_inner
. The returned Vec
is guaranteed to be valid as any combination of bits
in a Vec
of u8
is valid.
Fields§
§inner: Box<[u8]>