pub trait EasyDuration: Sized {
// Required method
fn seconds(self) -> Duration;
// Provided methods
fn minutes(self) -> Duration { ... }
fn hours(self) -> Duration { ... }
fn days(self) -> Duration { ... }
}Expand description
A trait to simplify construction a std::time::Duration from numeric types.
The trait is implemented for the common numeric types, like i32, u32, …
Note that for signed integers, the absolute value will be used.