Struct memfd::Memfd [−][src]
An anonymous volatile file, with sealing capabilities.
Implementations
impl Memfd
[src]
pub fn try_from_fd<F>(fd: F) -> Result<Self, F> where
F: AsRawFd + IntoRawFd,
[src]
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.
pub fn try_from_file(file: File) -> Result<Self, File>
[src]
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.
pub fn as_file(&self) -> &File
[src]
Return a reference to the backing File
.
pub fn into_file(self) -> File
[src]
Convert Memfd
to the backing File
.
pub fn seals(&self) -> Result<SealsHashSet, Error>
[src]
Obtain the current set of seals for the Memfd
.
pub fn add_seal(&self, seal: FileSeal) -> Result<(), Error>
[src]
Add a seal to the existing set of seals.
pub fn add_seals(&self, seals: &SealsHashSet) -> Result<(), Error>
[src]
Add some seals to the existing set of seals.
Trait Implementations
impl AsRawFd for Memfd
[src]
impl Debug for Memfd
[src]
impl FromRawFd for Memfd
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Memfd
[src]
impl IntoRawFd for Memfd
[src]
fn into_raw_fd(self) -> RawFd
[src]
Auto Trait Implementations
impl RefUnwindSafe for Memfd
[src]
impl Send for Memfd
[src]
impl Sync for Memfd
[src]
impl Unpin for Memfd
[src]
impl UnwindSafe for Memfd
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,