[][src]Struct utctimestamp::UtcTimeStamp

#[repr(transparent)]pub struct UtcTimeStamp(_);

Represents a dumb but fast UTC timestamp.

Implementations

impl UtcTimeStamp[src]

pub const fn zero() -> Self[src]

Initialize a timestamp with 0, 1970-01-01 00:00:00 UTC.

pub fn now() -> Self[src]

Initialize a timestamp using the current local time converted to UTC.

pub const fn from_milliseconds(int: i64) -> Self[src]

Explicit conversion from i64.

pub const fn from_seconds(int: i64) -> Self[src]

Explicit conversion from i64 seconds.

pub const fn as_milliseconds(self) -> i64[src]

Explicit conversion to i64.

pub const fn align_to(self, freq: TimeDelta) -> UtcTimeStamp[src]

Align a timestamp to a given frequency.

pub const fn align_to_anchored(
    self,
    anchor: UtcTimeStamp,
    freq: TimeDelta
) -> UtcTimeStamp
[src]

Align a timestamp to a given frequency, with a time anchor.

pub const fn is_zero(self) -> bool[src]

Check whether the timestamp is 0 (1970-01-01 00:00:00 UTC).

Trait Implementations

impl Add<TimeDelta> for UtcTimeStamp[src]

Calculate the timestamp advanced by a timedelta.

type Output = UtcTimeStamp

The resulting type after applying the + operator.

impl AddAssign<TimeDelta> for UtcTimeStamp[src]

impl Clone for UtcTimeStamp[src]

impl Copy for UtcTimeStamp[src]

impl Debug for UtcTimeStamp[src]

impl Display for UtcTimeStamp[src]

Display timestamp using chrono.

impl Eq for UtcTimeStamp[src]

impl From<DateTime<Utc>> for UtcTimeStamp[src]

Create a dumb timestamp from a chrono date time object.

impl From<UtcTimeStamp> for DateTime<Utc>[src]

Create a chrono date time object from a dumb timestamp.

impl Hash for UtcTimeStamp[src]

impl Ord for UtcTimeStamp[src]

impl PartialEq<UtcTimeStamp> for UtcTimeStamp[src]

impl PartialOrd<UtcTimeStamp> for UtcTimeStamp[src]

impl StructuralEq for UtcTimeStamp[src]

impl StructuralPartialEq for UtcTimeStamp[src]

impl Sub<TimeDelta> for UtcTimeStamp[src]

Calculate the timestamp lessened by a timedelta.

type Output = UtcTimeStamp

The resulting type after applying the - operator.

impl Sub<UtcTimeStamp> for UtcTimeStamp[src]

Calculate signed timedelta between two timestamps.

type Output = TimeDelta

The resulting type after applying the - operator.

impl SubAssign<TimeDelta> for UtcTimeStamp[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.