Struct hinix::eventfd::EventFd[][src]

pub struct EventFd { /* fields omitted */ }
Expand description

An event object that can be used as a wait/notify mechanism between user-space applications, threads in an app, or between the kernel and user-space.

This is a simpler, more efficient signaling mechanism than a pipe, if event notification is all that is required by the application.

The event is seen as a normal file handle, and thus can be used in combination with other handles such as from sockets, pipes, etc, in a poll/epoll/select call to provide additional signaling capabilities.

Implementations

Create a new event object.

This is the default configuration of the event object with no flags. When read, the value is returned and the count is reset to zero.

Parameters

initval The initial value held by the object

Create a new event object with the semaphore option.

This is applies the EDF_SEMAPHORE flag. When read, the value returned is 1, and the value is decremented by 1.

Parameters

initval The initial value held by the object

Create a new event object with the specified flags.

Parameters

initval The initial value held by the object flags The flags used to create the object

http://man7.org/linux/man-pages/man2/eventfd.2.html

Try to clone the event object by making a dup() of the OS file handle.

Reads the value of the event object.

Writes a value to the event object.

Parameters

val The value to add to the one held by the object.

Trait Implementations

Gets the raw file handle for the event object.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.