pub trait TimeTraits: Copy + Sized {
// Required methods
fn ns(self) -> Dt;
fn us(self) -> Dt;
fn ms(self) -> Dt;
fn sec(self) -> Dt;
fn min(self) -> Dt;
fn hr(self) -> Dt;
fn days(self) -> Dt;
fn wk(self) -> Dt;
fn yr(self) -> Dt;
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.
§Example:
use deep_time::TimeTraits;
let dt = 5.days();Required Methods§
fn ns(self) -> Dt
fn us(self) -> Dt
fn ms(self) -> Dt
fn sec(self) -> Dt
fn min(self) -> Dt
fn hr(self) -> Dt
fn days(self) -> Dt
fn wk(self) -> Dt
fn yr(self) -> Dt
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".