pub struct UserMemory { /* private fields */ }Expand description
UserMemory facilitates testing code that requires user memory.
Example:
let mut mem = UserMemory::create(size).unwrap();
mem.commit_and_map(size).unwrap();
let out_ptr = UserOutPtr::
Implementations§
Source§impl UserMemory
impl UserMemory
pub fn create(size: usize) -> Option<Self>
pub fn base(&self) -> usize
Sourcepub fn commit_and_map(&mut self, size: usize) -> Result<(), Status>
pub fn commit_and_map(&mut self, size: usize) -> Result<(), Status>
Ensures the mapping is committed and mapped such that usages will cause no faults.
Trait Implementations§
Source§impl Drop for UserMemory
impl Drop for UserMemory
Auto Trait Implementations§
impl !RefUnwindSafe for UserMemory
impl !Send for UserMemory
impl !Sync for UserMemory
impl !UnwindSafe for UserMemory
impl Freeze for UserMemory
impl Unpin for UserMemory
impl UnsafeUnpin for UserMemory
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more