pub struct Memfd { /* private fields */ }Expand description
An anonymous volatile file, with sealing capabilities.
Implementations
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Memfd
impl Send for Memfd
impl Sync for Memfd
impl Unpin for Memfd
impl UnwindSafe for Memfd
Blanket Implementations
sourceimpl<T> AsRawFilelike for T where
T: AsRawFd,
impl<T> AsRawFilelike for T where
T: AsRawFd,
sourcefn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsRawSocketlike for T where
T: AsRawFd,
impl<T> AsRawSocketlike for T where
T: AsRawFd,
sourcefn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromRawFilelike for T where
T: FromRawFd,
impl<T> FromRawFilelike for T where
T: FromRawFd,
sourceunsafe fn from_raw_filelike(raw: i32) -> T
unsafe fn from_raw_filelike(raw: i32) -> T
Constructs Self from the raw value. Read more
sourceimpl<T> FromRawSocketlike for T where
T: FromRawFd,
impl<T> FromRawSocketlike for T where
T: FromRawFd,
sourceunsafe fn from_raw_socketlike(raw: i32) -> T
unsafe fn from_raw_socketlike(raw: i32) -> T
Constructs Self from the raw value. Read more
sourceimpl<T> IntoRawFilelike for T where
T: IntoRawFd,
impl<T> IntoRawFilelike for T where
T: IntoRawFd,
sourcefn into_raw_filelike(self) -> i32
fn into_raw_filelike(self) -> i32
Returns the raw value.
sourceimpl<T> IntoRawSocketlike for T where
T: IntoRawFd,
impl<T> IntoRawSocketlike for T where
T: IntoRawFd,
sourcefn into_raw_socketlike(self) -> i32
fn into_raw_socketlike(self) -> i32
Returns the raw value.