Trait 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§

Source

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.

Source

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.

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§