Struct shared_memory::Shmem
source · pub struct Shmem { /* private fields */ }
Expand description
Structure used to extract information from an existing shared memory mapping
Implementations§
source§impl Shmem
impl Shmem
sourcepub fn set_owner(&mut self, is_owner: bool) -> bool
pub fn set_owner(&mut self, is_owner: bool) -> bool
Allows for gaining/releasing ownership of the mapping
Warning : You must ensure at least one process owns the mapping in order to ensure proper cleanup code is ran
sourcepub fn get_flink_path(&self) -> Option<&PathBuf>
pub fn get_flink_path(&self) -> Option<&PathBuf>
Returns the flink path if present
sourcepub unsafe fn as_slice(&self) -> &[u8] ⓘ
pub unsafe fn as_slice(&self) -> &[u8] ⓘ
Returns mapping as a byte slice
§Safety
This function is unsafe because it is impossible to ensure the range of bytes is immutable
sourcepub unsafe fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
pub unsafe fn as_slice_mut(&mut self) -> &mut [u8] ⓘ
Returns mapping as a mutable byte slice
§Safety
This function is unsafe because it is impossible to ensure the returned mutable refence is unique/exclusive
Auto Trait Implementations§
impl Freeze for Shmem
impl RefUnwindSafe for Shmem
impl !Send for Shmem
impl !Sync for Shmem
impl Unpin for Shmem
impl UnwindSafe for Shmem
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