pub struct EventFd(/* private fields */);Implementations§
source§impl EventFd
impl EventFd
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
EventFd::from_value_and_flags with init_val = 0 and flags = EfdFlags::empty().
sourcepub fn from_value_and_flags(init_val: u32, flags: EfdFlags) -> Result<Self>
pub fn from_value_and_flags(init_val: u32, flags: EfdFlags) -> Result<Self>
Constructs EventFd with the given init_val and flags.
Wrapper around libc::eventfd.
sourcepub fn from_flags(flags: EfdFlags) -> Result<Self>
pub fn from_flags(flags: EfdFlags) -> Result<Self>
EventFd::from_value_and_flags with init_val = 0 and given flags.
sourcepub fn from_value(init_val: u32) -> Result<Self>
pub fn from_value(init_val: u32) -> Result<Self>
EventFd::from_value_and_flags with given init_val and flags = EfdFlags::empty().
sourcepub fn arm(&self) -> Result<usize>
pub fn arm(&self) -> Result<usize>
Arms self, a following call to poll, select or epoll will return immediately.
EventFd::write with 1.
sourcepub fn defuse(&self) -> Result<usize>
pub fn defuse(&self) -> Result<usize>
Defuses self, a following call to poll, select or epoll will block.
EventFd::write with 0.
sourcepub fn write(&self, value: u64) -> Result<usize>
pub fn write(&self, value: u64) -> Result<usize>
Enqueues value triggers.
The next value calls to poll, select or epoll will return immediately.
EventFd::write with value.
pub fn read(&self) -> Result<u64>
Trait Implementations§
source§impl AsFd for EventFd
impl AsFd for EventFd
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl Freeze for EventFd
impl RefUnwindSafe for EventFd
impl Send for EventFd
impl Sync for EventFd
impl Unpin for EventFd
impl UnwindSafe for EventFd
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