Struct memmap2::RemapOptions

source ·
pub struct RemapOptions { /* private fields */ }
Expand description

Options for Mmap::remap and MmapMut::remap.

Implementations§

source§

impl RemapOptions

source

pub fn new() -> Self

Creates a mew set of options for resizing a memory map.

source

pub fn may_move(self, may_move: bool) -> Self

Controls whether the memory map can be moved if it is not possible to resize it in place.

If false then the memory map is guaranteed to remain at the same address when being resized but attempting to resize will return an error if the new memory map would overlap with something else in the current process’ memory.

By default this is false.

may_move and StableDeref

If the stable_deref_trait feature is enabled then Mmap and MmapMut implement StableDeref. StableDeref promises that the memory map dereferences to a fixed address, however, calling remap with may_move set may result in the backing memory of the mapping being moved to a new address. This may cause UB in other code depending on the StableDeref guarantees.

Trait Implementations§

source§

impl Clone for RemapOptions

source§

fn clone(&self) -> RemapOptions

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for RemapOptions

source§

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

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

impl Default for RemapOptions

source§

fn default() -> RemapOptions

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

impl Copy for RemapOptions

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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.
source§

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

Performs the conversion.