Skip to main content

Mmap

Struct Mmap 

Source
#[non_exhaustive]
pub struct Mmap {}
Available on crate feature full only.
Expand description

A basic map of virtual to physical memory.

In certain build configurations, this may include guard pages to check for out-of-bounds access. If a guaranteed amount of virtual address space usage of virtual location is required, see UncheckedMmap.

When combined with virtual_location, the use of guard pages may mean that the valid start of the virtual allocation is not at the requested location. Retrieve the valid start using virtual_valid_start, as_ptr, or similar after creating the mapping to get the correct address.

Trait Implementations§

Source§

impl Clone for Mmap

Source§

fn clone(&self) -> Mmap

Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Mmap

Source§

impl Debug for Mmap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mmap

Source§

fn default() -> Mmap

Returns the “default value” for a type. Read more
Source§

impl Mappable for Mmap

Source§

fn virtual_size(&self, frame_count: usize) -> NonZero<usize>

The number of pages required to create a mapping with frame_count frames.
Source§

fn base_virtual_offset(&self) -> isize

The number of pages to offset the physical memory into the allocated virtual memory.

Auto Trait Implementations§

§

impl Freeze for Mmap

§

impl RefUnwindSafe for Mmap

§

impl Send for Mmap

§

impl Sync for Mmap

§

impl Unpin for Mmap

§

impl UnsafeUnpin for Mmap

§

impl UnwindSafe for Mmap

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.