Struct userfaultfd::UffdBuilder [−][src]
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
impl RefUnwindSafe for UffdBuilder
impl Send for UffdBuilder
impl Sync for UffdBuilder
impl Unpin for UffdBuilder
impl UnwindSafe for UffdBuilder
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, 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>,