Struct eventfd::EventFD [] [src]

pub struct EventFD { /* fields omitted */ }

Methods

impl EventFD
[src]

[src]

Create a new EventFD. Flags is the bitwise OR of EFD_* constants, or 0 for no flags. The underlying file descriptor is closed when the EventFD instance's lifetime ends.

TODO: work out how to integrate this FD into the wider world of fds. There's currently no way to poll/select on the fd.

[src]

Read the current value of the eventfd. This will block until the value is non-zero. In semaphore mode this will only ever decrement the count by 1 and return 1; otherwise it atomically returns the current value and sets it to zero.

[src]

Add to the current value. Blocks if the value would wrap u64.

[src]

Return a stream of events. The channel has a synchronous sender because there's no point in building up a queue of events; if this task blocks on send, the event state will still update.

The task will exit if the receiver end is shut down.

This will be a CPU-spin loop if the EventFD is created non-blocking.

XXX FIXME This has no way of terminating except if the other end closes the connection, and only then if we're not blocked in the read()...

Trait Implementations

impl Send for EventFD
[src]

impl Sync for EventFD
[src]

impl AsRawFd for EventFD
[src]

[src]

Return the raw underlying fd. The caller must make sure self's lifetime is longer than any users of the fd.

impl Drop for EventFD
[src]

[src]

Executes the destructor for this type. Read more

impl Clone for EventFD
[src]

Construct a linked clone of an existing EventFD. Once created, the new instance interacts with the original in a way that's indistinguishable from the original.

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations