[][src]Struct sys_util::TimerFd

pub struct TimerFd(_);

A safe wrapper around a Linux timerfd (man 2 timerfd_create).

Methods

impl TimerFd[src]

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

Creates a new timerfd. The timer is initally disarmed and must be armed by calling reset.

pub fn reset(&mut self, dur: Duration, interval: Option<Duration>) -> Result<()>[src]

Sets the timer to expire after dur. If interval is not None it represents the period for repeated expirations after the initial expiration. Otherwise the timer will expire just once. Cancels any existing duration and repeating interval.

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

Waits until the timer expires. The return value represents the number of times the timer has expired since the last time wait was called. If the timer has not yet expired once this call will block until it does.

pub fn is_armed(&self) -> Result<bool>[src]

Returns true if the timer is currently armed.

pub fn clear(&mut self) -> Result<()>[src]

Disarms the timer.

Trait Implementations

impl IntoRawFd for TimerFd[src]

impl AsRawFd for TimerFd[src]

impl FromRawFd for TimerFd[src]

Auto Trait Implementations

impl Send for TimerFd

impl Sync for TimerFd

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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut 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.