pub struct Tai64N(pub Tai64, pub u32);Expand description
A TAI64N timestamp.
Invariant: The nanosecond part <= 999999999.
Tuple Fields§
§0: Tai64§1: u32Implementations§
Source§impl Tai64N
impl Tai64N
Sourcepub const UNIX_EPOCH: Self
pub const UNIX_EPOCH: Self
Unix epoch in TAI64N: 1970-01-01 00:00:10 TAI.
Sourcepub fn from_slice(slice: &[u8]) -> Result<Self, Error>
pub fn from_slice(slice: &[u8]) -> Result<Self, Error>
Parse TAI64N from a byte slice
Sourcepub fn duration_since(&self, other: &Self) -> Result<Duration, Duration>
pub fn duration_since(&self, other: &Self) -> Result<Duration, Duration>
Calculate how much time passes since the other timestamp.
Returns Ok(Duration) if other is earlier than self,
Err(Duration) otherwise.
Sourcepub fn from_system_time(t: &SystemTime) -> Self
pub fn from_system_time(t: &SystemTime) -> Self
Convert SystemTime to TAI64N.
Sourcepub fn to_system_time(self) -> SystemTime
pub fn to_system_time(self) -> SystemTime
Convert TAI64Nto SystemTime.
Trait Implementations§
Source§impl From<SystemTime> for Tai64N
impl From<SystemTime> for Tai64N
Source§fn from(t: SystemTime) -> Self
fn from(t: SystemTime) -> Self
Converts to this type from the input type.
Source§impl Ord for Tai64N
impl Ord for Tai64N
Source§impl PartialOrd for Tai64N
impl PartialOrd for Tai64N
impl Copy for Tai64N
impl Eq for Tai64N
impl StructuralPartialEq for Tai64N
Auto Trait Implementations§
impl Freeze for Tai64N
impl RefUnwindSafe for Tai64N
impl Send for Tai64N
impl Sync for Tai64N
impl Unpin for Tai64N
impl UnwindSafe for Tai64N
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more