Struct shared_memory::ShmemConf
source · 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: AsRef<str>>(self, os_id: S) -> Self
pub fn os_id<S: AsRef<str>>(self, os_id: S) -> Self
Provide a specific os identifier for the mapping
When not specified, a randomly generated identifier will be used
sourcepub fn force_create_flink(self) -> Self
pub fn force_create_flink(self) -> Self
Overwrites file links if it already exist when calling create()
sourcepub fn flink<S: AsRef<Path>>(self, path: S) -> Self
pub fn flink<S: AsRef<Path>>(self, path: S) -> Self
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) -> Self
pub fn size(self, size: usize) -> Self
Sets the size of the mapping that will be used in create()
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)