Struct UnixTime

struct UnixTime(_)

A timestamp, tracking the number of non-leap seconds since the Unix epoch.

The Unix epoch is defined January 1, 1970 00:00:00 UTC.

Implementations

impl UnixTime

fn now() -> Self

The current time, as a UnixTime

fn since_unix_epoch(duration: Duration) -> Self

Convert a Duration since the start of 1970 to a UnixTime

The duration must be relative to the Unix epoch.

fn as_secs(self: &Self) -> u64

Number of seconds since the Unix epoch

impl Clone for UnixTime

fn clone(self: &Self) -> UnixTime

impl Copy for UnixTime

impl Debug for UnixTime

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for UnixTime

impl Freeze for UnixTime

impl Ord for UnixTime

fn cmp(self: &Self, other: &UnixTime) -> Ordering

impl PartialEq for UnixTime

fn eq(self: &Self, other: &UnixTime) -> bool

impl PartialOrd for UnixTime

fn partial_cmp(self: &Self, other: &UnixTime) -> Option<Ordering>

impl RefUnwindSafe for UnixTime

impl Send for UnixTime

impl StructuralPartialEq for UnixTime

impl Sync for UnixTime

impl Unpin for UnixTime

impl UnwindSafe for UnixTime

impl<T> Any for UnixTime

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for UnixTime

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for UnixTime

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for UnixTime

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for UnixTime

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for UnixTime

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for UnixTime

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for UnixTime

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for UnixTime

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>