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 fn new() -> Self
pub 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 fn allow_sealing(self, value: bool) -> Self
pub fn allow_sealing(self, value: bool) -> Self
Whether to allow adding seals to the created Memfd
.
sourcepub fn close_on_exec(self, value: bool) -> Self
pub fn close_on_exec(self, value: bool) -> Self
Whether to set the FD_CLOEXEC
flag on the created Memfd
.
sourcepub fn hugetlb(self, size: Option<HugetlbSize>) -> Self
pub 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