Struct memfile::CreateOptions[][src]

pub struct CreateOptions { /* fields omitted */ }
Expand description

Options for creating a MemFile.

Support for options depend on platform and OS details. Refer to your OS documentation for memfd_create for more information.

Implementations

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.

Create a new MemFile` with the current options.

This is a shorthand for MemFile::create. See that function for more details.

Create a new MemFile` with the current options.

This is identical to Self::create, except that it takes the name as CStr to avoid allocations. See MemFile::create for more details.

Allow sealing operations on the created MemFile.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.