pub struct MlsTime { /* private fields */ }
Expand description
Wasm-compatible representation of a timestamp.
This type represents a point in time after 1970. The precision is seconds.
Since MlsTime
always represents a timestamp after 1970, it can be trivially
converted to/from a standard library Duration
value (measuring the time since
the start of the Unix epoch).
Implementations§
Source§impl MlsTime
impl MlsTime
Sourcepub fn from_duration_since_epoch(duration: Duration) -> MlsTime
pub fn from_duration_since_epoch(duration: Duration) -> MlsTime
Create a timestamp from a duration since unix epoch.
Sourcepub fn seconds_since_epoch(&self) -> u64
pub fn seconds_since_epoch(&self) -> u64
Number of seconds since the unix epoch.
Trait Implementations§
Source§impl Ord for MlsTime
impl Ord for MlsTime
Source§impl PartialOrd for MlsTime
impl PartialOrd for MlsTime
Source§impl TryFrom<SystemTime> for MlsTime
impl TryFrom<SystemTime> for MlsTime
Source§type Error = SystemTimeError
type Error = SystemTimeError
The type returned in the event of a conversion error.
Source§fn try_from(
value: SystemTime,
) -> Result<MlsTime, <MlsTime as TryFrom<SystemTime>>::Error>
fn try_from( value: SystemTime, ) -> Result<MlsTime, <MlsTime as TryFrom<SystemTime>>::Error>
Performs the conversion.
impl Copy for MlsTime
impl Eq for MlsTime
impl StructuralPartialEq for MlsTime
Auto Trait Implementations§
impl Freeze for MlsTime
impl RefUnwindSafe for MlsTime
impl Send for MlsTime
impl Sync for MlsTime
impl Unpin for MlsTime
impl UnwindSafe for MlsTime
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§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