Struct memfile::CreateOptions[][src]

pub struct CreateOptions { /* fields omitted */ }

Options for creating a MemFile.

Support for options depend on platform and OS details. Refer to your kernel documentation of memfd_create for details.

Implementations

impl CreateOptions[src]

pub fn new() -> Self[src]

Get the default creation options for a MemFile.

Initially, file sealing is not enabled no no huge TLB page size is configured.

Note that the close-on-exec flag will always be set on the created file descriptor. If you want to pass it to a child process, you should use libc::dup2 or something similar after forking. Disabling the close-on-exec flag before forking causes a race condition with other threads.

pub fn allow_sealing(&mut self, value: bool) -> &mut Self[src]

Allow sealing operations on the created MemFile.

pub fn huge_tlb(&mut self, value: Option<HugeTlb>) -> &mut Self[src]

Create the file in a hugetlbfs filesystem using huge pages for the translation look-aside buffer.

Support for this feature and specific sizes depend on the CPU and kernel configuration. See also: https://www.kernel.org/doc/html/latest/admin-guide/mm/hugetlbpage.html

Trait Implementations

impl Clone for CreateOptions[src]

impl Copy for CreateOptions[src]

impl Debug for CreateOptions[src]

impl Default for CreateOptions[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.