[][src]Struct mohan::tai64::TAI64N

pub struct TAI64N(pub TAI64, pub u32);

A TAI64N timestamp.

Invariant: The nanosecond part <= 999999999.

Methods

impl TAI64N[src]

pub fn now() -> TAI64N[src]

Get TAI64N timestamp according to system clock.

pub fn from_slice(slice: &[u8]) -> Result<TAI64N, Error>[src]

Parse TAI64N from a byte slice

pub fn to_bytes(self) -> [u8; 12][src]

Serialize TAI64N as bytes

pub fn duration_since(&self, other: &TAI64N) -> Result<Duration, Duration>[src]

Calculate how much time passes since the other timestamp.

Returns Ok(Duration) if other is earlier than self, Err(Duration) otherwise.

pub fn from_system_time(t: &SystemTime) -> Self[src]

Convert SystemTime to TAI64N.

pub fn to_system_time(&self) -> SystemTime[src]

Convert TAI64Nto SystemTime.

Trait Implementations

impl Eq for TAI64N[src]

impl Clone for TAI64N[src]

impl PartialOrd<TAI64N> for TAI64N[src]

impl PartialEq<TAI64N> for TAI64N[src]

impl Ord for TAI64N[src]

impl From<TAI64N> for TAI64[src]

fn from(other: TAI64N) -> TAI64[src]

Remove the nanosecond component from a TAI64N value

impl From<TAI64> for TAI64N[src]

fn from(other: TAI64) -> TAI64N[src]

Remove the nanosecond component from a TAI64N value

impl From<TAI64N> for [u8; 12][src]

fn from(tai: TAI64N) -> [u8; 12][src]

Serialize TAI64 to external representation

impl From<SystemTime> for TAI64N[src]

impl Copy for TAI64N[src]

impl Hash for TAI64N[src]

impl Add<Duration> for TAI64N[src]

type Output = TAI64N

The resulting type after applying the + operator.

impl Sub<Duration> for TAI64N[src]

type Output = TAI64N

The resulting type after applying the - operator.

impl Debug for TAI64N[src]

impl TryFrom<[u8; 12]> for TAI64N[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_from(bytes: [u8; 12]) -> Result<TAI64N, Error>[src]

Parse TAI64 from external representation

Auto Trait Implementations

impl Send for TAI64N

impl Unpin for TAI64N

impl Sync for TAI64N

impl UnwindSafe for TAI64N

impl RefUnwindSafe for TAI64N

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[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.

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

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

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

impl<N> NodeTrait for N where
    N: Copy + Ord + Hash
[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self