Struct ntp_proto::NtpTimestamp
source · pub struct NtpTimestamp { /* private fields */ }Expand description
NtpTimestamp represents an ntp timestamp without the era number.
Implementations§
source§impl NtpTimestamp
impl NtpTimestamp
sourcepub const fn from_seconds_nanos_since_ntp_era(seconds: u32, nanos: u32) -> Self
pub const fn from_seconds_nanos_since_ntp_era(seconds: u32, nanos: u32) -> Self
Create an NTP timestamp from the number of seconds and nanoseconds that have passed since the last ntp era boundary.
pub fn is_before(self, other: NtpTimestamp) -> bool
Trait Implementations§
source§impl Add<NtpDuration> for NtpTimestamp
impl Add<NtpDuration> for NtpTimestamp
§type Output = NtpTimestamp
type Output = NtpTimestamp
The resulting type after applying the
+ operator.source§impl AddAssign<NtpDuration> for NtpTimestamp
impl AddAssign<NtpDuration> for NtpTimestamp
source§fn add_assign(&mut self, rhs: NtpDuration)
fn add_assign(&mut self, rhs: NtpDuration)
Performs the
+= operation. Read moresource§impl Clone for NtpTimestamp
impl Clone for NtpTimestamp
source§fn clone(&self) -> NtpTimestamp
fn clone(&self) -> NtpTimestamp
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for NtpTimestamp
impl Debug for NtpTimestamp
source§impl Default for NtpTimestamp
impl Default for NtpTimestamp
source§fn default() -> NtpTimestamp
fn default() -> NtpTimestamp
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for NtpTimestamp
impl<'de> Deserialize<'de> for NtpTimestamp
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Distribution<NtpTimestamp> for Standard
impl Distribution<NtpTimestamp> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NtpTimestamp
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> NtpTimestamp
Generate a random value of
T, using rng as the source of randomness.source§impl Ord for NtpTimestamp
impl Ord for NtpTimestamp
source§fn cmp(&self, other: &NtpTimestamp) -> Ordering
fn cmp(&self, other: &NtpTimestamp) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<NtpTimestamp> for NtpTimestamp
impl PartialEq<NtpTimestamp> for NtpTimestamp
source§fn eq(&self, other: &NtpTimestamp) -> bool
fn eq(&self, other: &NtpTimestamp) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<NtpTimestamp> for NtpTimestamp
impl PartialOrd<NtpTimestamp> for NtpTimestamp
source§fn partial_cmp(&self, other: &NtpTimestamp) -> Option<Ordering>
fn partial_cmp(&self, other: &NtpTimestamp) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for NtpTimestamp
impl Serialize for NtpTimestamp
source§impl Sub<NtpDuration> for NtpTimestamp
impl Sub<NtpDuration> for NtpTimestamp
§type Output = NtpTimestamp
type Output = NtpTimestamp
The resulting type after applying the
- operator.source§impl Sub<NtpTimestamp> for NtpTimestamp
impl Sub<NtpTimestamp> for NtpTimestamp
source§impl SubAssign<NtpDuration> for NtpTimestamp
impl SubAssign<NtpDuration> for NtpTimestamp
source§fn sub_assign(&mut self, rhs: NtpDuration)
fn sub_assign(&mut self, rhs: NtpDuration)
Performs the
-= operation. Read moreimpl Copy for NtpTimestamp
impl Eq for NtpTimestamp
impl StructuralEq for NtpTimestamp
impl StructuralPartialEq for NtpTimestamp
Auto Trait Implementations§
impl RefUnwindSafe for NtpTimestamp
impl Send for NtpTimestamp
impl Sync for NtpTimestamp
impl Unpin for NtpTimestamp
impl UnwindSafe for NtpTimestamp
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