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§
Sourcefn timestamp_millis(&self) -> i64
fn timestamp_millis(&self) -> i64
Gets the timestamp as the number milliseconds that have elapsed since the EPOCH
Provided Methods§
Sourcefn datetime(&self) -> DateTime<Utc>
fn datetime(&self) -> DateTime<Utc>
Converts the timestamp into a chrono DateTime structure for easier date / time formatting
Sourcefn timestamp_seconds(&self) -> i64
fn timestamp_seconds(&self) -> i64
Gets the timestamp as the number of seconds that have elapsed since the EPOCH