Struct memmap2::os::MmapInner

source ·
pub struct MmapInner {
    ptr: *mut c_void,
    len: usize,
}

Fields§

§ptr: *mut c_void§len: usize

Implementations§

source§

impl MmapInner

source

fn new( len: usize, prot: c_int, flags: c_int, file: RawFd, offset: u64 ) -> Result<MmapInner>

Creates a new MmapInner.

This is a thin wrapper around the mmap sytem call.

source

pub fn map( len: usize, file: RawFd, offset: u64, populate: bool ) -> Result<MmapInner>

source

pub fn map_exec( len: usize, file: RawFd, offset: u64, populate: bool ) -> Result<MmapInner>

source

pub fn map_mut( len: usize, file: RawFd, offset: u64, populate: bool ) -> Result<MmapInner>

source

pub fn map_copy( len: usize, file: RawFd, offset: u64, populate: bool ) -> Result<MmapInner>

source

pub fn map_copy_read_only( len: usize, file: RawFd, offset: u64, populate: bool ) -> Result<MmapInner>

source

pub fn map_anon(len: usize, stack: bool, populate: bool) -> Result<MmapInner>

Open an anonymous memory map.

source

pub fn flush(&self, offset: usize, len: usize) -> Result<()>

source

pub fn flush_async(&self, offset: usize, len: usize) -> Result<()>

source

fn mprotect(&mut self, prot: c_int) -> Result<()>

source

pub fn make_read_only(&mut self) -> Result<()>

source

pub fn make_exec(&mut self) -> Result<()>

source

pub fn make_mut(&mut self) -> Result<()>

source

pub fn ptr(&self) -> *const u8

source

pub fn mut_ptr(&mut self) -> *mut u8

source

pub fn len(&self) -> usize

source

pub fn advise(&self, advice: Advice, offset: usize, len: usize) -> Result<()>

source

pub fn lock(&self) -> Result<()>

source

pub fn unlock(&self) -> Result<()>

Trait Implementations§

source§

impl Drop for MmapInner

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for MmapInner

source§

impl Sync for MmapInner

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.