Struct jormungandr_lib::time::SystemTime
source · pub struct SystemTime(SystemTime);
Expand description
time in seconds and nanoseconds since UNIX Epoch
The human readable formatting is ISO8601 compliant.
Example
let time = SystemTime::now();
println!("now: {}", time);
// now: 2019-06-17T18:17:20.417032+00:00
Tuple Fields§
§0: SystemTime
Implementations§
source§impl SystemTime
impl SystemTime
sourcepub fn now() -> Self
pub fn now() -> Self
get the current time in seconds since UNIX Epoch
pub fn duration_since( &self, earlier: SystemTime ) -> Result<Duration, SystemTimeError>
source§impl SystemTime
impl SystemTime
pub fn from_secs_since_epoch(secs: u64) -> Self
pub fn duration_since_epoch(self) -> Duration
Trait Implementations§
source§impl AsRef<SystemTime> for SystemTime
impl AsRef<SystemTime> for SystemTime
source§fn as_ref(&self) -> &SystemTime
fn as_ref(&self) -> &SystemTime
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for SystemTime
impl Clone for SystemTime
source§fn clone(&self) -> SystemTime
fn clone(&self) -> SystemTime
Returns a copy of the value. Read more
1.0.0 · 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 SystemTime
impl Debug for SystemTime
source§impl<'de> Deserialize<'de> for SystemTime
impl<'de> Deserialize<'de> for SystemTime
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for SystemTime
impl Display for SystemTime
source§impl From<SecondsSinceUnixEpoch> for SystemTime
impl From<SecondsSinceUnixEpoch> for SystemTime
source§fn from(seconds: SecondsSinceUnixEpoch) -> SystemTime
fn from(seconds: SecondsSinceUnixEpoch) -> SystemTime
Converts to this type from the input type.
source§impl From<SystemTime> for SecondsSinceUnixEpoch
impl From<SystemTime> for SecondsSinceUnixEpoch
source§fn from(system_time: SystemTime) -> SecondsSinceUnixEpoch
fn from(system_time: SystemTime) -> SecondsSinceUnixEpoch
Converts to this type from the input type.
source§impl From<SystemTime> for SystemTime
impl From<SystemTime> for SystemTime
source§fn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Converts to this type from the input type.
source§impl From<SystemTime> for SystemTime
impl From<SystemTime> for SystemTime
source§fn from(system_time: SystemTime) -> Self
fn from(system_time: SystemTime) -> Self
Converts to this type from the input type.
source§impl FromStr for SystemTime
impl FromStr for SystemTime
source§impl Hash for SystemTime
impl Hash for SystemTime
source§impl Ord for SystemTime
impl Ord for SystemTime
source§fn cmp(&self, other: &SystemTime) -> Ordering
fn cmp(&self, other: &SystemTime) -> Ordering
1.21.0 · 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<SystemTime> for SystemTime
impl PartialEq<SystemTime> for SystemTime
source§fn eq(&self, other: &SystemTime) -> bool
fn eq(&self, other: &SystemTime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<SystemTime> for SystemTime
impl PartialOrd<SystemTime> for SystemTime
source§fn partial_cmp(&self, other: &SystemTime) -> Option<Ordering>
fn partial_cmp(&self, other: &SystemTime) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for SystemTime
impl Serialize for SystemTime
source§impl TryFrom<SystemTime> for LocalDateTime
impl TryFrom<SystemTime> for LocalDateTime
§type Error = SystemTimeError
type Error = SystemTimeError
The type returned in the event of a conversion error.
impl Copy for SystemTime
impl Eq for SystemTime
impl StructuralEq for SystemTime
impl StructuralPartialEq for SystemTime
Auto Trait Implementations§
impl RefUnwindSafe for SystemTime
impl Send for SystemTime
impl Sync for SystemTime
impl Unpin for SystemTime
impl UnwindSafe for SystemTime
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