Struct casper_node::types::Timestamp[][src]

pub struct Timestamp(_);

A timestamp type, representing a concrete moment in time.

Implementations

impl Timestamp[src]

pub fn now() -> Self[src]

Returns the timestamp of the current moment

pub fn elapsed(&self) -> TimeDiff[src]

Returns the time that has elapsed since this timestamp

pub fn zero() -> Self[src]

Returns a zero timestamp

pub fn millis(&self) -> u64[src]

Returns the timestamp as the number of milliseconds since the Unix epoch

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

Returns the difference between self and other, or 0 if self is earlier than other.

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

Returns the difference between self and other, or 0 if that would be before the epoch.

pub fn trailing_zeros(&self) -> u8[src]

Returns the number of trailing zeros in the number of milliseconds since the epoch.

Trait Implementations

impl Add<TimeDiff> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the + operator.

impl AddAssign<TimeDiff> for Timestamp[src]

impl Clone for Timestamp[src]

impl Copy for Timestamp[src]

impl DataSize for Timestamp[src]

impl Debug for Timestamp[src]

impl<'de> Deserialize<'de> for Timestamp[src]

impl Display for Timestamp[src]

impl Div<TimeDiff> for Timestamp[src]

type Output = u64

The resulting type after applying the / operator.

impl DocExample for Timestamp[src]

impl Eq for Timestamp[src]

impl From<u64> for Timestamp[src]

impl FromBytes for Timestamp[src]

impl FromStr for Timestamp[src]

type Err = TimestampError

The associated error which can be returned from parsing.

impl Hash for Timestamp[src]

impl JsonSchema for Timestamp[src]

impl Ord for Timestamp[src]

impl PartialEq<Timestamp> for Timestamp[src]

impl PartialOrd<Timestamp> for Timestamp[src]

impl Rem<TimeDiff> for Timestamp[src]

type Output = TimeDiff

The resulting type after applying the % operator.

impl Serialize for Timestamp[src]

impl<__RhsT> Shl<__RhsT> for Timestamp where
    u64: Shl<__RhsT, Output = u64>, 
[src]

type Output = Timestamp

The resulting type after applying the << operator.

impl<__RhsT> Shr<__RhsT> for Timestamp where
    u64: Shr<__RhsT, Output = u64>, 
[src]

type Output = Timestamp

The resulting type after applying the >> operator.

impl StructuralEq for Timestamp[src]

impl StructuralPartialEq for Timestamp[src]

impl Sub<TimeDiff> for Timestamp[src]

type Output = Timestamp

The resulting type after applying the - operator.

impl Sub<Timestamp> for Timestamp[src]

type Output = TimeDiff

The resulting type after applying the - operator.

impl ToBytes for Timestamp[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> CallHasher for T where
    T: Hash

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> FmtForward for T

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> RuleType for T where
    T: Copy + Debug + Eq + Hash + Ord
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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> TryConv for T

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]