[−][src]Struct shared_memory::SharedMemConf
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
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, SharedMemError>
[src]
self,
lock_type: LockType,
offset: usize,
length: usize
) -> Result<SharedMemConf, SharedMemError>
Adds a lock of specified type on a range of bytes
pub fn overwrite_link(self)
[src]
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]
self,
event_type: EventType
) -> Result<SharedMemConf, SharedMemError>
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.
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
Trait Implementations
impl Default for SharedMemConf
[src]
Auto Trait Implementations
impl !Send for SharedMemConf
impl Unpin for SharedMemConf
impl !Sync for SharedMemConf
impl !UnwindSafe for SharedMemConf
impl !RefUnwindSafe for SharedMemConf
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> 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<U> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,