Trait Instant

Source
pub trait Instant
where Self: Add<Duration, Output = Self> + Sub<Duration, Output = Self> + Sub<Self, Output = Duration> + Sized + Clone + Copy + PartialEq + Eq + PartialOrd + Ord,
{ // Required method fn now() -> Self; }
Expand description

A trait that defines an instant.

§Implementations

Implementations for the following types are provided with the corresponding features enabled:

TypeFeatureTarget Arch
std::time::Instant"std"non-wasm32
tokio::time::Instant"tokio"non-wasm32
[wasm_timer::Instant]"wasm-timer"wasm32
[fluvio_wasm_timer::Instant]"fluvio-wasm-timer"wasm32

User could also provide their own implementations for other types to use the timer functionalities provided by this crate.

Required Methods§

Source

fn now() -> Self

Returns the instant that is “now”

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.

Implementations on Foreign Types§

Source§

impl Instant for Instant

Source§

fn now() -> Self

Source§

impl Instant for Instant

Source§

fn now() -> Self

Implementors§