Struct memfd::MemfdOptions
source · pub struct MemfdOptions { /* private fields */ }Expand description
A Memfd builder, providing advanced options and flags for specifying its behavior.
Implementations§
source§impl MemfdOptions
impl MemfdOptions
sourcepub const fn new() -> Self
pub const fn new() -> Self
Default set of options for Memfd creation.
The default options are:
FileSeal::SealSeal(i.e. no further sealing);- close-on-exec is disabled;
- hugetlb is disabled.
sourcepub const fn allow_sealing(self, value: bool) -> Self
pub const fn allow_sealing(self, value: bool) -> Self
Whether to allow adding seals to the created Memfd.
sourcepub const fn close_on_exec(self, value: bool) -> Self
pub const fn close_on_exec(self, value: bool) -> Self
Whether to set the FD_CLOEXEC flag on the created Memfd.
sourcepub const fn hugetlb(self, size: Option<HugetlbSize>) -> Self
pub const fn hugetlb(self, size: Option<HugetlbSize>) -> Self
Optional hugetlb support and page size for the created Memfd.
Trait Implementations§
source§impl Clone for MemfdOptions
impl Clone for MemfdOptions
source§fn clone(&self) -> MemfdOptions
fn clone(&self) -> MemfdOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more