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>
pub fn try_from_fd<F>(fd: F) -> Result<Self, F>
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
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Memfd
impl RefUnwindSafe for Memfd
impl Send for Memfd
impl Sync for Memfd
impl Unpin for Memfd
impl UnwindSafe for Memfd
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