[][src]Struct shared_memory::SharedMemConf

pub struct SharedMemConf { /* fields omitted */ }

Configuration used to describe a shared memory mapping before openning/creation

Methods

impl SharedMemConf[src]

pub fn set_size(self, wanted_size: usize) -> SharedMemConf[src]

Sets the size of the usable memory in the mapping

Sets the path for the link file

pub fn set_os_path(self, unique_id: &str) -> SharedMemConf[src]

Sets a specific unique_id to be used when creating the mapping

pub fn add_lock(
    self,
    lock_type: LockType,
    offset: usize,
    length: usize
) -> Result<SharedMemConf, SharedMemError>
[src]

Adds a lock of specified type on a range of bytes

Forces the creation of the link file regardless of if the file already exists

pub fn add_event(
    self,
    event_type: EventType
) -> Result<SharedMemConf, SharedMemError>
[src]

Adds an event of specified type

pub fn create(self) -> Result<SharedMem, SharedMemError>[src]

Creates a shared memory mapping from the current config values

pub fn open(self) -> Result<SharedMem, SharedMemError>[src]

Opens a shared memory mapping.

This will look at the current link_path/os_path to create the SharedMem. Other values will be reset.

Returns the currently set link_path value

pub fn get_os_path(&self) -> Option<&str>[src]

Returns the currently set os_path value

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

Return the current size of the user data

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

Returns the current size that the metadata will take

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

Returns the current number of locks

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

Returns the current number of events

Trait Implementations

impl Default for SharedMemConf[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> 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.

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

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

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