pub trait TimeUnits: Copy + Sized {
// Required methods
fn ns(self) -> TSpan;
fn us(self) -> TSpan;
fn ms(self) -> TSpan;
fn sec(self) -> TSpan;
fn min(self) -> TSpan;
fn hr(self) -> TSpan;
fn days(self) -> TSpan;
fn wk(self) -> TSpan;
fn yr(self) -> TSpan;
fn ago(self, scale: Scale) -> Dt;
fn from_now(self, scale: Scale) -> Dt;
}Expand description
Trait that adds ergonomic time-unit methods to integers and floats.
Import it explicitly to create TSpans directly from rust ints and floats:
use deep_time::TimeUnits;
Required Methods§
fn ns(self) -> TSpan
fn us(self) -> TSpan
fn ms(self) -> TSpan
fn sec(self) -> TSpan
fn min(self) -> TSpan
fn hr(self) -> TSpan
fn days(self) -> TSpan
fn wk(self) -> TSpan
fn yr(self) -> TSpan
fn ago(self, scale: Scale) -> Dt
fn from_now(self, scale: Scale) -> Dt
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.