pub trait FromUnixTimestamp {
// Required method
fn from_unix_timestamp(secs: u64) -> Self;
}Expand description
A trait for types that can be constructed from a Unix timestamp.
This allows mtime_as_datetime to work with any datetime type,
not just std::time::SystemTime.
Required Methods§
Sourcefn from_unix_timestamp(secs: u64) -> Self
fn from_unix_timestamp(secs: u64) -> Self
Create an instance from the number of seconds since the Unix epoch (00:00:00 GMT, Jan. 1, 1970).
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.
Implementations on Foreign Types§
Source§impl FromUnixTimestamp for SystemTime
Available on crate feature std only.
impl FromUnixTimestamp for SystemTime
Available on crate feature
std only.