[][src]Struct fog_pack::Timestamp

pub struct Timestamp {
    pub sec: i64,
    pub nano: u32,
}

Structure for holding a raw fog-pack timestamp.

Fields

sec: i64nano: u32

Implementations

impl Timestamp[src]

pub fn from_raw(sec: i64, nano: u32) -> Option<Timestamp>[src]

Create a UTC timestamp from a raw seconds + nanoseconds value

pub fn from_sec(sec: i64) -> Timestamp[src]

pub fn min_value() -> Timestamp[src]

Minimum possible time that can be represented

pub fn max_value() -> Timestamp[src]

Maximum possible time that can be represented

pub fn min(self, other: Timestamp) -> Timestamp[src]

pub fn max(self, other: Timestamp) -> Timestamp[src]

pub fn next(self) -> Timestamp[src]

Add 1 nanosecond to timestamp. Will go into leap second (nanoseconds > 1e6) before it goes to the next second.

pub fn prev(self) -> Timestamp[src]

Subtract 1 nanosecond from timestamp. Will go into leap second (nanoseconds > 1e6) when it must decrement a second.

pub fn timestamp(&self) -> i64[src]

Return the UNIX timestamp (number of seconds since January 1, 1970 0:00:00 UTC)

pub fn timestamp_subsec_nanos(&self) -> u32[src]

pub fn now() -> Option<Timestamp>[src]

Create a Timestamp based on the current system time. Can fail if the system clock is extremely wrong - the time is before Unix Epoch, or nanosecond portion is greater than 2 seconds.

Trait Implementations

impl Add<i64> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the + operator.

impl Clone for Timestamp[src]

impl Copy for Timestamp[src]

impl Debug for Timestamp[src]

impl Display for Timestamp[src]

impl Eq for Timestamp[src]

impl From<Timestamp> for Value[src]

impl Ord for Timestamp[src]

impl PartialEq<Timestamp> for Timestamp[src]

impl PartialOrd<Timestamp> for Timestamp[src]

impl StructuralEq for Timestamp[src]

impl StructuralPartialEq for Timestamp[src]

impl Sub<i64> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the - operator.

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.