Struct shared_memory_server::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>(self, os_id: S) -> ShmemConfwhere
S: AsRef<str>,
pub fn os_id<S>(self, os_id: S) -> ShmemConfwhere S: AsRef<str>,
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) -> ShmemConfwhere
S: AsRef<Path>,
pub fn flink<S>(self, path: S) -> ShmemConfwhere S: AsRef<Path>,
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 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