Trait base::sys::linux::SharedMemoryLinux
source · pub trait SharedMemoryLinux {
// Required methods
fn from_file(file: File) -> Result<SharedMemory>;
fn get_seals(&self) -> Result<MemfdSeals>;
fn add_seals(&mut self, seals: MemfdSeals) -> Result<()>;
}
Required Methods§
sourcefn from_file(file: File) -> Result<SharedMemory>
fn from_file(file: File) -> Result<SharedMemory>
Constructs a SharedMemory
instance from a File
that represents shared memory.
The size of the resulting shared memory will be determined using File::seek
. If the given
file’s size can not be determined this way, this will return an error.
sourcefn get_seals(&self) -> Result<MemfdSeals>
fn get_seals(&self) -> Result<MemfdSeals>
Gets the memfd seals that have already been added to this.
This may fail if this instance was not constructed from a memfd.
sourcefn add_seals(&mut self, seals: MemfdSeals) -> Result<()>
fn add_seals(&mut self, seals: MemfdSeals) -> Result<()>
Adds the given set of memfd seals.
This may fail if this instance was not constructed from a memfd with sealing allowed or if
the seal seal (F_SEAL_SEAL
) bit was already added.
Object Safety§
This trait is not object safe.