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
.
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§
§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere
T: AsRawFd,
§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
Returns the raw value.
§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
§fn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
§impl<T> FromRawFilelike for Twhere
T: FromRawFd,
impl<T> FromRawFilelike for Twhere
T: FromRawFd,
§unsafe fn from_raw_filelike(raw: i32) -> T
unsafe fn from_raw_filelike(raw: i32) -> T
Constructs
Self
from the raw value. Read more§impl<T> FromRawSocketlike for Twhere
T: FromRawFd,
impl<T> FromRawSocketlike for Twhere
T: FromRawFd,
§unsafe fn from_raw_socketlike(raw: i32) -> T
unsafe fn from_raw_socketlike(raw: i32) -> T
Constructs
Self
from the raw value. Read more§impl<T> IntoRawFilelike for Twhere
T: IntoRawFd,
impl<T> IntoRawFilelike for Twhere
T: IntoRawFd,
§fn into_raw_filelike(self) -> i32
fn into_raw_filelike(self) -> i32
Returns the raw value.
§impl<T> IntoRawSocketlike for Twhere
T: IntoRawFd,
impl<T> IntoRawSocketlike for Twhere
T: IntoRawFd,
§fn into_raw_socketlike(self) -> i32
fn into_raw_socketlike(self) -> i32
Returns the raw value.