[−][src]Struct sys_util::FakeClock
A fake clock that can be used in tests to give exact control over the time. For a code example, see the tests in sys_util/src/timerfd.rs.
Methods
impl FakeClock
[src]
pub fn new() -> Self
[src]
pub fn now(&self) -> Self
[src]
Get the current time, according to this clock.
pub fn nanos(&self) -> u64
[src]
Get the current time in ns, according to this clock.
pub fn duration_since(&self, earlier: &Self) -> Duration
[src]
Get the duration since |earlier|, assuming that earlier < self.
pub fn add_event_fd(&mut self, deadline_ns: u64, fd: EventFd)
[src]
Register the event fd for a notification when self's time is |deadline_ns|. Drop any existing events registered to the same raw fd.
pub fn add_ns(&mut self, ns: u64)
[src]
Trait Implementations
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 = !
🔬 This is a nightly-only experimental API. (
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,