pub struct ShmemConf { /* private fields */ }
Expand description
Struct used to configure different parameters before creating a shared memory mapping
Implementations§
Source§impl ShmemConf
impl ShmemConf
Sourcepub fn os_id<S>(self, os_id: S) -> ShmemConf
pub fn os_id<S>(self, os_id: S) -> ShmemConf
Provide a specific os identifier for the mapping
When not specified, a randomly generated identifier will be used
Sourcepub fn force_create_flink(self) -> ShmemConf
pub fn force_create_flink(self) -> ShmemConf
Overwrites file links if it already exist when calling create()
Sourcepub fn flink<S>(self, path: S) -> ShmemConf
pub fn flink<S>(self, path: S) -> ShmemConf
Create the shared memory mapping with a file link
This creates a file on disk that contains the unique os_id for the mapping. This can be useful when application want to rely on filesystems to share mappings
Sourcepub fn size(self, size: usize) -> ShmemConf
pub fn size(self, size: usize) -> ShmemConf
Sets the size of the mapping that will be used in create()
Sourcepub fn writable(self, writable: bool) -> ShmemConf
pub fn writable(self, writable: bool) -> ShmemConf
Specifies whether the region should be writable by this process.
Enabled by default.
Sourcepub fn create(self) -> Result<Shmem, ShmemError>
pub fn create(self) -> Result<Shmem, ShmemError>
Create a new mapping using the current configuration
Sourcepub fn open(self) -> Result<Shmem, ShmemError>
pub fn open(self) -> Result<Shmem, ShmemError>
Opens an existing mapping using the current configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShmemConf
impl RefUnwindSafe for ShmemConf
impl Send for ShmemConf
impl Sync for ShmemConf
impl Unpin for ShmemConf
impl UnwindSafe for ShmemConf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more