Struct sntpc::StdTimestampGen
source · pub struct StdTimestampGen { /* private fields */ }
Expand description
Standard library timestamp generator wrapper type
that relies on std::time
to provide timestamps during SNTP client operations
Trait Implementations§
source§impl Clone for StdTimestampGen
impl Clone for StdTimestampGen
source§fn clone(&self) -> StdTimestampGen
fn clone(&self) -> StdTimestampGen
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 Default for StdTimestampGen
impl Default for StdTimestampGen
source§fn default() -> StdTimestampGen
fn default() -> StdTimestampGen
Returns the “default value” for a type. Read more
source§impl NtpTimestampGenerator for StdTimestampGen
impl NtpTimestampGenerator for StdTimestampGen
source§fn init(&mut self)
fn init(&mut self)
Initialize timestamp generator state with
now
system time since UNIX EPOCH.
Expected to be called every time before timestamp_sec
and
timestamp_subsec_micros
usage. Basic flow would be the following: Read moresource§fn timestamp_sec(&self) -> u64
fn timestamp_sec(&self) -> u64
Returns timestamp in seconds since UNIX EPOCH for the initialized generator
source§fn timestamp_subsec_micros(&self) -> u32
fn timestamp_subsec_micros(&self) -> u32
Returns the fractional part of the timestamp in whole micro seconds.
That method should not return microseconds since UNIX EPOCH
impl Copy for StdTimestampGen
Auto Trait Implementations§
impl RefUnwindSafe for StdTimestampGen
impl Send for StdTimestampGen
impl Sync for StdTimestampGen
impl Unpin for StdTimestampGen
impl UnwindSafe for StdTimestampGen
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