TimeUnitTrait

Trait TimeUnitTrait 

Source
pub trait TimeUnitTrait:
    Copy
    + Clone
    + Debug
    + PartialEq
    + Eq
    + Hash
    + PartialOrd
    + Ord {
    // Required method
    fn unit() -> TimeUnit;
}
Expand description

A trait for types representing time units.

This trait is implemented by types that represent specific units of time, such as years, months, days, hours, etc. It provides a common interface for these types and ensures they have certain properties and behaviors.

Required Methods§

Source

fn unit() -> TimeUnit

Returns the corresponding TimeUnit enum variant for this time unit.

§Returns

A TimeUnit enum variant representing the specific time unit.

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.

Implementors§