pub struct OrbitEpoch(/* private fields */);Expand description
Milliseconds since the Unix epoch, carried in Frame::ver by
time-sensitive Orbit primitives.
Implementations§
Source§impl OrbitEpoch
impl OrbitEpoch
pub const ZERO: Self
pub fn now() -> Self
pub fn from_system_time(time: SystemTime) -> Self
pub const fn from_unix_ms(epoch_ms: u64) -> Self
pub const fn as_unix_ms(self) -> u64
pub fn age_at(self, now: Self) -> Duration
pub fn is_fresh_at(self, now: Self, max_age: Duration) -> bool
Trait Implementations§
Source§impl Clone for OrbitEpoch
impl Clone for OrbitEpoch
Source§fn clone(&self) -> OrbitEpoch
fn clone(&self) -> OrbitEpoch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OrbitEpoch
impl Debug for OrbitEpoch
Source§impl Default for OrbitEpoch
impl Default for OrbitEpoch
Source§fn default() -> OrbitEpoch
fn default() -> OrbitEpoch
Returns the “default value” for a type. Read more
Source§impl Display for OrbitEpoch
impl Display for OrbitEpoch
Source§impl From<OrbitEpoch> for u64
impl From<OrbitEpoch> for u64
Source§fn from(value: OrbitEpoch) -> Self
fn from(value: OrbitEpoch) -> Self
Converts to this type from the input type.
Source§impl From<u64> for OrbitEpoch
impl From<u64> for OrbitEpoch
Source§impl Hash for OrbitEpoch
impl Hash for OrbitEpoch
Source§impl Ord for OrbitEpoch
impl Ord for OrbitEpoch
Source§fn cmp(&self, other: &OrbitEpoch) -> Ordering
fn cmp(&self, other: &OrbitEpoch) -> Ordering
1.21.0 (const: unstable) · 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 for OrbitEpoch
impl PartialEq for OrbitEpoch
Source§fn eq(&self, other: &OrbitEpoch) -> bool
fn eq(&self, other: &OrbitEpoch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for OrbitEpoch
impl PartialOrd for OrbitEpoch
impl Copy for OrbitEpoch
impl Eq for OrbitEpoch
impl StructuralPartialEq for OrbitEpoch
Auto Trait Implementations§
impl Freeze for OrbitEpoch
impl RefUnwindSafe for OrbitEpoch
impl Send for OrbitEpoch
impl Sync for OrbitEpoch
impl Unpin for OrbitEpoch
impl UnsafeUnpin for OrbitEpoch
impl UnwindSafe for OrbitEpoch
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