Struct userfaultfd::UffdBuilder[][src]

pub struct UffdBuilder { /* fields omitted */ }

A builder for initializing Uffd objects.

use userfaultfd::UffdBuilder;

let uffd = UffdBuilder::new()
    .close_on_exec(true)
    .non_blocking(true)
    .create();
assert!(uffd.is_ok());

Implementations

impl UffdBuilder[src]

pub fn new() -> UffdBuilder[src]

Create a new builder with no required features or ioctls, and close_on_exec and non_blocking both set to false.

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

Enable the close-on-exec flag for the new userfaultfd object (see the description of O_CLOEXEC in open(2)).

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

Enable non-blocking operation for the userfaultfd object.

If this is set to false, Uffd::read_event() will block until an event is available to read. Otherwise, it will immediately return None if no event is available.

pub fn require_features(&mut self, feature: FeatureFlags) -> &mut Self[src]

Add a requirement that a particular feature or set of features is available.

If a required feature is unavailable, UffdBuilder.create() will return an error.

pub fn require_ioctls(&mut self, ioctls: IoctlFlags) -> &mut Self[src]

Add a requirement that a particular ioctl or set of ioctls is available.

If a required ioctl is unavailable, UffdBuilder.create() will return an error.

pub fn create(&self) -> Result<Uffd>[src]

Create a Uffd object with the current settings of this builder.

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, 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.