Trait edge_util::easy_duration::EasyDuration
source · pub trait EasyDuration: Sized {
// Required method
fn seconds(self) -> Duration;
// Provided methods
fn minutes(self) -> Duration { ... }
fn hours(self) -> Duration { ... }
fn days(self) -> Duration { ... }
fn years(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.
Required Methods§
Provided Methods§
fn minutes(self) -> Duration
fn hours(self) -> Duration
fn days(self) -> Duration
fn years(self) -> Duration
Object Safety§
This trait is not object safe.