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
sourceimpl 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 RefUnwindSafe for ShmemConf
impl Send for ShmemConf
impl Sync for ShmemConf
impl Unpin for ShmemConf
impl UnwindSafe for ShmemConf
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more