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
Sourcepub fn from_unix_u64(value: u64) -> Self
pub fn from_unix_u64(value: u64) -> Self
Creates a new timestamp with a unix epoch
pub fn from_unix_raw(value: u64) -> Self
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
Available on crate feature
std only.pub fn as_only_seconds(&self) -> Self
pub fn as_only_fractional(&self) -> Self
pub fn as_epoch(&self, other: Epoch) -> Self
Methods from Deref<Target = FixedU64>§
pub const E: FixedU64
pub const PI: FixedU64
pub const ONE_HALF: FixedU64
pub const RESOLUTION: FixedU64
pub const LN10: 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 Ord for Time64
impl Ord for Time64
Source§impl PartialOrd for Time64
impl PartialOrd for Time64
impl Copy for Time64
impl Eq 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