[][src]Struct sys_util::EventFd

pub struct EventFd { /* fields omitted */ }

A safe wrapper around a Linux eventfd (man 2 eventfd).

An eventfd is useful because it is sendable across processes and can be used for signaling in and out of the KVM API. They can also be polled like any other file descriptor.

Methods

impl EventFd[src]

pub fn new() -> Result<EventFd>[src]

Creates a new blocking EventFd with an initial value of 0.

pub fn write(&self, v: u64) -> Result<()>[src]

Adds v to the eventfd's count, blocking until this won't overflow the count.

pub fn read(&self) -> Result<u64>[src]

Blocks until the the eventfd's count is non-zero, then resets the count to zero.

pub fn try_clone(&self) -> Result<EventFd>[src]

Clones this EventFd, internally creating a new file descriptor. The new EventFd will share the same underlying count within the kernel.

Trait Implementations

impl Debug for EventFd[src]

impl FromRawFd for EventFd[src]

impl IntoRawFd for EventFd[src]

impl AsRawFd for EventFd[src]

Auto Trait Implementations

impl Send for EventFd

impl Sync for EventFd

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]