pub struct Time64 { /* private fields */ }Expand description
64 Bit Fixed Precision Time Format, storing 32 bits of Seconds, and 32 bits
of Fractional Seconds. This is the equivalent of Q32.32, and is semantically
equivalent to the NTP Timestamp Format if using the epoch::NTP_EPOCH.
The 32-bit seconds field can resolve 136 years, and the 32-bit fractional field can resolve down to 232 picoseconds.
The raw value is 64 bits wide, if you take the middle 32
bits, this is identical to a Time32 - (lower 16 of seconds, upper 16 of
fractional_seconds).
Implementations§
source§impl Time64
impl Time64
pub const fn new(epoch: Epoch, seconds: u32, fractional_seconds: u32) -> Self
pub fn new_f64(epoch: Epoch, seconds: f64) -> Self
pub const fn get_seconds(&self) -> u32
pub const fn get_fractional_seconds(&self) -> u32
pub fn as_f64(&self) -> f64
pub fn try_from_iso8601(val: &str) -> Result<Self, FormatError>
pub fn now() -> Self
Methods from Deref<Target = FixedU64>§
pub const E: FixedU64 = _
pub const PI: FixedU64 = _
pub const ONE_HALF: FixedU64 = _
pub const RESOLUTION: FixedU64 = _
pub fn trunc(&self) -> u32
pub fn whole(&self) -> u32
pub fn fract(&self) -> u32
pub fn raw_value(&self) -> u64
pub fn as_f64(&self) -> f64
pub fn is_zero(&self) -> bool
Trait Implementations§
source§impl AddAssign<Duration> for &mut Time64
impl AddAssign<Duration> for &mut Time64
source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+= operation. Read moresource§impl AddAssign<Duration> for Time64
impl AddAssign<Duration> for Time64
source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+= operation. Read moresource§impl From<&UTCDateTime> for Time64
impl From<&UTCDateTime> for Time64
source§fn from(value: &UTCDateTime) -> Self
fn from(value: &UTCDateTime) -> Self
Converts to this type from the input type.
source§impl From<&mut UTCDateTime> for Time64
impl From<&mut UTCDateTime> for Time64
source§fn from(value: &mut UTCDateTime) -> Self
fn from(value: &mut UTCDateTime) -> Self
Converts to this type from the input type.
source§impl From<UTCDateTime> for Time64
impl From<UTCDateTime> for Time64
source§fn from(value: UTCDateTime) -> Self
fn from(value: UTCDateTime) -> Self
Converts to this type from the input type.
source§impl PartialOrd for Time64
impl PartialOrd for Time64
impl Copy for Time64
impl StructuralPartialEq for Time64
Auto Trait Implementations§
impl Freeze for Time64
impl RefUnwindSafe for Time64
impl Send for Time64
impl Sync for Time64
impl Unpin for Time64
impl UnwindSafe for Time64
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)