pub struct Shmem { /* private fields */ }
Expand description

Structure used to extract information from an existing shared memory mapping

Implementations§

source§

impl Shmem

source

pub fn is_owner(&self) -> bool

Returns whether we created the mapping or not

source

pub fn set_owner(&mut self, is_owner: bool) -> bool

Allows for gaining/releasing ownership of the mapping

Warning : You must ensure at least one process owns the mapping in order to ensure proper cleanup code is ran

source

pub fn get_os_id(&self) -> &str

Returns the OS unique identifier for the mapping

Returns the flink path if present

source

pub fn len(&self) -> usize

Returns the total size of the mapping

source

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

Returns a raw pointer to the mapping

source

pub unsafe fn as_slice(&self) -> &[u8]

Returns mapping as a byte slice

Safety

This function is unsafe because it is impossible to ensure the range of bytes is immutable

source

pub unsafe fn as_slice_mut(&mut self) -> &mut [u8]

Returns mapping as a mutable byte slice

Safety

This function is unsafe because it is impossible to ensure the returned mutable refence is unique/exclusive

Auto Trait Implementations§

§

impl RefUnwindSafe for Shmem

§

impl !Send for Shmem

§

impl !Sync for Shmem

§

impl Unpin for Shmem

§

impl UnwindSafe for Shmem

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V