[−][src]Struct shared_memory::SharedMemConf
Configuration used to describe a shared memory mapping before openning/creation
Methods
impl SharedMemConf[src]
pub fn new() -> SharedMemConf[src]
Returns a new SharedMemConf
pub fn set_size(self, wanted_size: usize) -> SharedMemConf[src]
Sets the size of the usable memory in the mapping
pub fn set_link_path<I: AsRef<OsStr>>(self, link_path: I) -> SharedMemConf[src]
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, Box<dyn Error>>[src]
self,
lock_type: LockType,
offset: usize,
length: usize
) -> Result<SharedMemConf, Box<dyn Error>>
Adds a lock of specified type on a range of bytes
pub fn add_event(
self,
event_type: EventType
) -> Result<SharedMemConf, Box<dyn Error>>[src]
self,
event_type: EventType
) -> Result<SharedMemConf, Box<dyn Error>>
Adds an event of specified type
pub fn create(self) -> Result<SharedMem, Box<dyn Error>>[src]
Creates a shared memory mapping from the current config values
pub fn open(self) -> Result<SharedMem, Box<dyn Error>>[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.
pub fn get_link_path(&self) -> Option<&Path>[src]
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
Auto Trait Implementations
impl !Send for SharedMemConf
impl !Sync for SharedMemConf
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,