Struct shared_memory::SharedMemConf [−][src]
pub struct SharedMemConf<'a> { /* fields omitted */ }
Configuration used to describe a shared memory mapping before openning/creation
Methods
impl<'a> SharedMemConf<'a>
[src]
impl<'a> SharedMemConf<'a>
pub fn new() -> SharedMemConf<'a>
[src]
pub fn new() -> SharedMemConf<'a>
Returns a new SharedMemConf
pub fn set_size(self, wanted_size: usize) -> SharedMemConf<'a>
[src]
pub fn set_size(self, wanted_size: usize) -> SharedMemConf<'a>
Sets the size of the usable memory in the mapping
pub fn set_link_path(self, link_path: &PathBuf) -> SharedMemConf<'a>
[src]
pub fn set_link_path(self, link_path: &PathBuf) -> SharedMemConf<'a>
Sets the path for the link file
pub fn set_os_path(self, unique_id: &str) -> SharedMemConf<'a>
[src]
pub fn set_os_path(self, unique_id: &str) -> SharedMemConf<'a>
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<'a>, Box<Error>>
[src]
pub fn add_lock(
self,
lock_type: LockType,
offset: usize,
length: usize
) -> Result<SharedMemConf<'a>, Box<Error>>
Adds a lock of specified type on a range of bytes
pub fn add_event(
self,
event_type: EventType
) -> Result<SharedMemConf<'a>, Box<Error>>
[src]
pub fn add_event(
self,
event_type: EventType
) -> Result<SharedMemConf<'a>, Box<Error>>
Adds an event of specified type
pub fn create(self) -> Result<SharedMem<'a>, Box<Error>>
[src]
pub fn create(self) -> Result<SharedMem<'a>, Box<Error>>
Creates a shared memory mapping from the current config values
pub fn open(self) -> Result<SharedMem<'a>, Box<Error>>
[src]
pub fn open(self) -> Result<SharedMem<'a>, Box<Error>>
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<&PathBuf>
[src]
pub fn get_link_path(&self) -> Option<&PathBuf>
Returns the currently set link_path value
pub fn get_os_path(&self) -> Option<&String>
[src]
pub fn get_os_path(&self) -> Option<&String>
Returns the currently set os_path value
pub fn get_size(&self) -> usize
[src]
pub fn get_size(&self) -> usize
Return the current size of the user data
pub fn get_metadata_size(&self) -> usize
[src]
pub fn get_metadata_size(&self) -> usize
Returns the current size that the metadata will take
pub fn num_locks(&self) -> usize
[src]
pub fn num_locks(&self) -> usize
Returns the current number of locks
pub fn num_events(&self) -> usize
[src]
pub fn num_events(&self) -> usize
Returns the current number of events
Auto Trait Implementations
impl<'a> !Send for SharedMemConf<'a>
impl<'a> !Send for SharedMemConf<'a>
impl<'a> !Sync for SharedMemConf<'a>
impl<'a> !Sync for SharedMemConf<'a>