pub trait TimeIf {
// Required methods
fn current_ticks() -> u64;
fn ticks_to_nanos(ticks: u64) -> u64;
fn nanos_to_ticks(nanos: u64) -> u64;
fn epochoffset_nanos() -> u64;
fn set_oneshot_timer(deadline_ns: u64);
}
Expand description
Time-related interfaces.
Required Methods§
Sourcefn current_ticks() -> u64
fn current_ticks() -> u64
Returns the current clock time in hardware ticks.
Sourcefn ticks_to_nanos(ticks: u64) -> u64
fn ticks_to_nanos(ticks: u64) -> u64
Converts hardware ticks to nanoseconds.
Sourcefn nanos_to_ticks(nanos: u64) -> u64
fn nanos_to_ticks(nanos: u64) -> u64
Converts nanoseconds to hardware ticks.
Sourcefn epochoffset_nanos() -> u64
fn epochoffset_nanos() -> u64
Return epoch offset in nanoseconds (wall time offset to monotonic clock start).
Sourcefn set_oneshot_timer(deadline_ns: u64)
fn set_oneshot_timer(deadline_ns: u64)
Set a one-shot timer.
A timer interrupt will be triggered at the specified monotonic time deadline (in nanoseconds).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.