[−][src]Struct sys_util::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 FromRawFd for TimerFd
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
impl IntoRawFd for TimerFd
[src]
fn into_raw_fd(self) -> RawFd
[src]
impl AsRawFd for TimerFd
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,