Module cros_async::mem

source ·

Structs

  • Used to index subslices of backing memory. Like an iovec, but relative to the start of the backing memory instead of an absolute pointer. The backing memory referenced by the region can be an array, an mmapped file, or guest memory. The offset is a u64 to allow having file or guest offsets >4GB when run on a 32bit host.
  • Iterator over an ordered list of MemRegion.
  • 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.

Enums

Traits

  • Trait for memory that can yield both iovecs in to the backing memory.

Type Definitions