Trait cros_async::mem::BackingMemory
source · pub unsafe trait BackingMemory {
// Required method
fn get_volatile_slice(
&self,
mem_range: MemRegion
) -> Result<VolatileSlice<'_>>;
}
Expand description
Trait for memory that can yield both iovecs in to the backing memory.
§Safety
Must be OK to modify the backing memory without owning a mut able reference. For example, this is safe for GuestMemory and VolatileSlices in crosvm as those types guarantee they are dealt with as volatile.
Required Methods§
sourcefn get_volatile_slice(&self, mem_range: MemRegion) -> Result<VolatileSlice<'_>>
fn get_volatile_slice(&self, mem_range: MemRegion) -> Result<VolatileSlice<'_>>
Returns VolatileSlice pointing to the backing memory. This is most commonly unsafe. To implement this safely the implementor must guarantee that the backing memory can be modified out of band without affecting safety guarantees.