pub struct Mapping { /* private fields */ }Expand description
A safe wrapper around a mapped region of memory.
Note: this type implements Deref/DerefMut to the SharedBuffer
type, which allows reading/writing from the underlying memory.
Aside from creation and the Drop impl, all of the interesting
functionality of this type is offered via SharedBuffer.
Implementations§
Source§impl Mapping
impl Mapping
Sourcepub fn allocate(size: usize) -> Result<(Self, Vmo), Status>
pub fn allocate(size: usize) -> Result<(Self, Vmo), Status>
Create a Mapping and map it in the root address space.
Returns the VMO that was mapped.
The resulting VMO will not be resizeable.
Sourcepub fn allocate_with_name(
size: usize,
name: &str,
) -> Result<(Self, Vmo), Status>
pub fn allocate_with_name( size: usize, name: &str, ) -> Result<(Self, Vmo), Status>
Create a Mapping and map it in the root address space.
Returns the VMO that was mapped.
The resulting VMO will not be resizeable.
Methods from Deref<Target = SharedBuffer>§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mapping
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnwindSafe for Mapping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more