pub struct Memfd { /* private fields */ }
Expand description
An anonymous volatile file, with sealing capabilities.
Implementations§
source§impl Memfd
impl Memfd
sourcepub fn try_from_fd<F>(fd: F) -> Result<Self, F>where
F: AsRawFd + IntoRawFd,
pub fn try_from_fd<F>(fd: F) -> Result<Self, F>where
F: AsRawFd + IntoRawFd,
Try to convert an object that owns a file descriptor into a Memfd
.
This function consumes the ownership of the specified object. If the underlying
file-descriptor is compatible with memfd/sealing, a Memfd
object is returned.
Otherwise the supplied object is returned as error.
sourcepub fn try_from_file(file: File) -> Result<Self, File>
pub fn try_from_file(file: File) -> Result<Self, File>
Try to convert a File
object into a Memfd
.
This function consumes the ownership of the specified File
. If the underlying
file-descriptor is compatible with memfd/sealing, a Memfd
object is returned.
Otherwise the supplied File
is returned for further usage.
sourcepub fn seals(&self) -> Result<SealsHashSet, Error>
pub fn seals(&self) -> Result<SealsHashSet, Error>
Obtain the current set of seals for the Memfd
.