pub struct UserMem { /* private fields */ }
Expand description
Wrapper to safely allocate memory for guest VMs.
The underlying memory is freed automatically once the UserMem
instance is dropped.
Memory can be mapped into a guest VM with
Vm::set_user_memory_region
.
Implementations
sourceimpl UserMem
impl UserMem
sourcepub fn new(len: usize) -> Result<UserMem>
pub fn new(len: usize) -> Result<UserMem>
Allocate a zero-initialized memory region of len
bytes.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for UserMem
impl !Send for UserMem
impl !Sync for UserMem
impl Unpin for UserMem
impl UnwindSafe for UserMem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more