Struct memfd::Memfd[][src]

pub struct Memfd { /* fields omitted */ }
This is supported on Linux only.

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]

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]

Convert a raw file-descriptor to a Memfd.

This function consumes ownership of the specified file descriptor. Memfd will take responsibility for closing it when the object goes out of scope.

Safety

fd must be a valid file descriptor representing a memfd file.

impl IntoRawFd for Memfd[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.