pub struct TimerFd(/* private fields */);
Expand description
A safe wrapper around a Linux timerfd (man 2 timerfd_create).
Implementations§
Source§impl TimerFd
impl TimerFd
Sourcepub fn new() -> Result<TimerFd>
pub fn new() -> Result<TimerFd>
Creates a new timerfd. The timer is initally disarmed and must be armed by calling
reset
.
Sourcepub fn reset(&mut self, dur: Duration, interval: Option<Duration>) -> Result<()>
pub fn reset(&mut self, dur: Duration, interval: Option<Duration>) -> Result<()>
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimerFd
impl RefUnwindSafe for TimerFd
impl Send for TimerFd
impl Sync for TimerFd
impl Unpin for TimerFd
impl UnwindSafe for TimerFd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more