[][src]Struct sunrise_libuser::types::MappedSharedMemory

pub struct MappedSharedMemory {
    handle: SharedMemory,
    addr: usize,
    size: usize,
    perm: MemoryPermissions,
}

A mapping to a shared memory region.

When dropped, the memory region will be unmapped, and the SharedMemory handle associated with it will be closed.

Fields

handle: SharedMemoryaddr: usizesize: usizeperm: MemoryPermissions

Implementations

impl MappedSharedMemory[src]

pub fn as_ptr(&self) -> *const u8[src]

Gets a raw pointer to the underlying shared memory.

The pointer is valid until the MappedSharedMemory instance gets dropped.

pub fn as_mut_ptr(&self) -> *mut u8[src]

Gets a mutable raw pointer to the underlying shared memory.

The pointer is valid until the MappedSharedMemory instance gets dropped.

pub fn len(&self) -> usize[src]

Gets the byte length of the mapped shared memory.

pub fn as_shared_mem(&self) -> &SharedMemory[src]

Return a reference to the underlying shared memory. Useful to send a copy of the handle of an already mapped shared memory via IPC.

Trait Implementations

impl Debug for MappedSharedMemory[src]

impl Drop for MappedSharedMemory[src]

Auto Trait Implementations

impl RefUnwindSafe for MappedSharedMemory

impl Send for MappedSharedMemory

impl Sync for MappedSharedMemory

impl Unpin for MappedSharedMemory

impl UnwindSafe for MappedSharedMemory

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.