[−][src]Struct uhlc::NTP64
A NTP 64-bits format as specified in RFC-5909
The first 32-bits part is the number of second since the EPOCH of the physical clock,
and the second 32-bits part is the fraction of second.
In case it's part of a crate::Timestamp
generated by an crate::HLC
the last few bits are replaced
by the HLC logical counter. The size of this counter currently hard-coded in crate::CSIZE
.
Note that this timestamp in actually similar to a std::time::Duration
, as it doesn't
define an EPOCH. Only the NTP64::to_system_time()
and std::fmt::Display::fmt()
operations assume that
it's relative to UNIX_EPOCH (1st Jan 1970) to display the timpestamp in RFC-3339 format.
Implementations
impl NTP64
[src]
pub fn as_u64(&self) -> u64
[src]
Returns this NTP64 as a u64.
pub fn as_secs(&self) -> u32
[src]
Returns the 32-bits seconds part.
pub fn subsec_nanos(&self) -> u32
[src]
Returns the 32-bits fraction of second part converted to nanoseconds.
pub fn to_duration(&self) -> Duration
[src]
Convert to a Duration
.
pub fn to_system_time(&self) -> SystemTime
[src]
Convert to a SystemTime
(making the assumption that this NTP64 is relative to UNIX_EPOCH
).
Trait Implementations
impl<'_> Add<&'_ NTP64> for NTP64
[src]
type Output = <NTP64 as Add<NTP64>>::Output
The resulting type after applying the +
operator.
fn add(self, other: &NTP64) -> <NTP64 as Add<NTP64>>::Output
[src]
impl<'_, '_> Add<&'_ NTP64> for &'_ NTP64
[src]
type Output = <NTP64 as Add<NTP64>>::Output
The resulting type after applying the +
operator.
fn add(self, other: &NTP64) -> <NTP64 as Add<NTP64>>::Output
[src]
impl Add<NTP64> for NTP64
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl<'a> Add<NTP64> for &'a NTP64
[src]
type Output = <NTP64 as Add<NTP64>>::Output
The resulting type after applying the +
operator.
fn add(self, other: NTP64) -> <NTP64 as Add<NTP64>>::Output
[src]
impl Add<u64> for NTP64
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: u64) -> Self
[src]
impl AddAssign<u64> for NTP64
[src]
fn add_assign(&mut self, other: u64)
[src]
impl Clone for NTP64
[src]
impl Copy for NTP64
[src]
impl Debug for NTP64
[src]
impl Default for NTP64
[src]
impl Display for NTP64
[src]
impl Eq for NTP64
[src]
impl From<Duration> for NTP64
[src]
impl FromStr for NTP64
[src]
type Err = ParseNTP64Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Ord for NTP64
[src]
fn cmp(&self, other: &NTP64) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<NTP64> for NTP64
[src]
impl PartialOrd<NTP64> for NTP64
[src]
fn partial_cmp(&self, other: &NTP64) -> Option<Ordering>
[src]
fn lt(&self, other: &NTP64) -> bool
[src]
fn le(&self, other: &NTP64) -> bool
[src]
fn gt(&self, other: &NTP64) -> bool
[src]
fn ge(&self, other: &NTP64) -> bool
[src]
impl StructuralEq for NTP64
[src]
impl StructuralPartialEq for NTP64
[src]
impl Sub<NTP64> for NTP64
[src]
Auto Trait Implementations
impl RefUnwindSafe for NTP64
impl Send for NTP64
impl Sync for NTP64
impl Unpin for NTP64
impl UnwindSafe for NTP64
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,