Skip to main content

ToDuration

Trait ToDuration 

Source
pub trait ToDuration {
    // Required methods
    fn seconds(&self) -> Duration;
    fn days(&self) -> Duration;
    fn weeks(&self) -> Duration;
    fn months(&self) -> Duration;
    fn years(&self) -> Duration;
}
Expand description

Helper trait to convert integer counts into Durations.

Required Methods§

Source

fn seconds(&self) -> Duration

Convert the value into seconds.

Source

fn days(&self) -> Duration

Convert the value into days.

Source

fn weeks(&self) -> Duration

Convert the value into weeks.

Source

fn months(&self) -> Duration

Convert the value into months.

Source

fn years(&self) -> Duration

Convert the value into years.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToDuration for i32

Implementors§