Struct mapped_vmo::Mapping
source · 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.
sourcepub fn create_from_vmo(
vmo: &Vmo,
size: usize,
flags: VmarFlags
) -> Result<Self, Status>
pub fn create_from_vmo( vmo: &Vmo, size: usize, flags: VmarFlags ) -> Result<Self, Status>
Create a Mapping
from an existing VMO.
Requires that the VMO was not created with the RESIZABLE
option, and returns ZX_ERR_NOT_SUPPORTED
otherwise.
Methods from Deref<Target = SharedBuffer>§
Trait Implementations§
Auto Trait Implementations§
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