pub struct FakeTimerFd { /* private fields */ }Expand description
FakeTimerFd: For use in tests.
Implementations§
Source§impl FakeTimerFd
impl FakeTimerFd
Sourcepub fn new(clock: Arc<Mutex<FakeClock>>) -> Self
pub fn new(clock: Arc<Mutex<FakeClock>>) -> Self
Creates a new fake 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§
Source§impl AsRawFd for FakeTimerFd
impl AsRawFd for FakeTimerFd
Source§impl IntoRawFd for FakeTimerFd
impl IntoRawFd for FakeTimerFd
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl Freeze for FakeTimerFd
impl RefUnwindSafe for FakeTimerFd
impl Send for FakeTimerFd
impl Sync for FakeTimerFd
impl Unpin for FakeTimerFd
impl UnwindSafe for FakeTimerFd
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