Trait Timestamped

Source
pub trait Timestamped {
    // Required method
    fn timestamp_millis(&self) -> i64;

    // Provided methods
    fn datetime(&self) -> DateTime<Utc> { ... }
    fn timestamp_seconds(&self) -> i64 { ... }
}
Expand description

A collection of methods for a structure that has a single timestamp

Required Methods§

Source

fn timestamp_millis(&self) -> i64

Gets the timestamp as the number milliseconds that have elapsed since the EPOCH

Provided Methods§

Source

fn datetime(&self) -> DateTime<Utc>

Converts the timestamp into a chrono DateTime structure for easier date / time formatting

Source

fn timestamp_seconds(&self) -> i64

Gets the timestamp as the number of seconds that have elapsed since the EPOCH

Implementors§