Struct timerfd::TimerFd
[−]
[src]
pub struct TimerFd(_);
Represents a timerfd.
See also timerfd_create(2).
Methods
impl TimerFd[src]
fn new_custom(realtime_clock: bool,
nonblocking: bool,
cloexec: bool)
-> IoResult<TimerFd>
nonblocking: bool,
cloexec: bool)
-> IoResult<TimerFd>
Creates a new TimerFd.
By default, it uses the monotonic clock, is blocking and does not close on exec. The parameters allow you to change that.
fn new() -> IoResult<TimerFd>
Creates a new TimerFd with default settings.
Use new_custom to specify custom settings.
fn set_state(&mut self, state: TimerState) -> IoResult<TimerState>
Sets this timerfd to a given TimerState and returns the old state.
fn get_state(&self) -> IoResult<TimerState>
Returns the current TimerState.
fn read(&mut self) -> IoResult<u64>
Read from this timerfd.
Returns the number of timer expirations since the last read. If that number is zero, this function blocks until the timer expires (or returns an error if it's nonblocking).