pub struct EventNotifier { /* private fields */ }Available on Unix only.
Expand description
EventNotifier This is a generic event notifier that can be used with eventfd or pipefd. It allows writing a value to the file descriptor to notify an event.
§Examples
use std::os::fd::FromRawFd;
use std::os::unix::io::IntoRawFd;
use vmm_sys_util::event::EventNotifier;
let (_, writer) = std::io::pipe().expect("Failed to create pipe");
let notifier = unsafe { EventNotifier::from_raw_fd(writer.into_raw_fd()) };Implementations§
Trait Implementations§
Source§impl AsRawFd for EventNotifier
impl AsRawFd for EventNotifier
Source§impl Debug for EventNotifier
impl Debug for EventNotifier
Source§impl FromRawFd for EventNotifier
impl FromRawFd for EventNotifier
Source§unsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of
Self from the given raw file
descriptor. Read moreSource§impl IntoRawFd for EventNotifier
impl IntoRawFd for EventNotifier
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl Freeze for EventNotifier
impl RefUnwindSafe for EventNotifier
impl Send for EventNotifier
impl Sync for EventNotifier
impl Unpin for EventNotifier
impl UnwindSafe for EventNotifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more