Struct memfile::CreateOptions [−][src]
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]
fn clone(&self) -> CreateOptions
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CreateOptions
[src]
impl Debug for CreateOptions
[src]
impl Default for CreateOptions
[src]
fn default() -> CreateOptions
[src]
Auto Trait Implementations
impl RefUnwindSafe for CreateOptions
[src]
impl Send for CreateOptions
[src]
impl Sync for CreateOptions
[src]
impl Unpin for CreateOptions
[src]
impl UnwindSafe for CreateOptions
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,