Skip to main content

UnixSeconds

Trait UnixSeconds 

Source
pub trait UnixSeconds {
    // Required method
    fn unix_seconds(&self) -> i64;
}
Expand description

A point in time that time can show: seconds since the Unix epoch.

Implemented for i64 (seconds), [Timestamp] and SystemTime; implement it for a time type of another crate to pass it directly.

discord.js counterpart: none (time takes a Date or seconds).

Required Methods§

Source

fn unix_seconds(&self) -> i64

Whole seconds since 1970-01-01 00:00:00 UTC, rounded down (negative before it).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl UnixSeconds for SystemTime

Source§

fn unix_seconds(&self) -> i64

Saturates at i64::MIN / i64::MAX for times billions of years away.

Source§

impl UnixSeconds for Timestamp

Source§

impl UnixSeconds for i64

Source§

impl<T: UnixSeconds + ?Sized> UnixSeconds for &T

Implementors§