pub enum Time {
Unknown,
Known {
s: u32,
ms: u16,
},
}Expand description
A time, t32 · ms16: seconds and milliseconds since the deployment
epoch E (core §7.6), or unknown.
Variants§
Unknown
t32 all ones with ms16 0: the owner’s clock is unknown.
Known
t32 seconds and ms16 milliseconds since the deployment epoch. A
writer refuses an ms16 above 999, and a t32 all ones, which reads as
unknown with ms16 0 and is unused with any other (time).
Implementations§
Source§impl Time
impl Time
Sourcepub fn from_unix_ms(t: i128, epoch: i64) -> Option<Time>
pub fn from_unix_ms(t: i128, epoch: i64) -> Option<Time>
The time of an instant t, in milliseconds since the Unix epoch,
under the deployment epoch epoch in seconds: t32 = ⌊(t − 1000 ×
E) / 1000⌋ and ms16 = (t − 1000 × E) modulo 1000. None before the
epoch, and from t32 all ones on, which no known time takes.
Trait Implementations§
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Forget for Time
impl Freeze for Time
impl Move for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more