pub struct TimeSnapshot { /* private fields */ }Implementations§
Source§impl TimeSnapshot
impl TimeSnapshot
pub fn now_utc() -> Self
Sourcepub fn now_local() -> Self
pub fn now_local() -> Self
Captures the current time. Internally stored as UTC; local offset is
applied at output time via to_local_rfc3339().
pub fn unix_seconds(&self) -> i64
pub fn unix_millis(&self) -> i64
pub fn to_rfc3339(&self) -> String
pub fn to_local_rfc3339(&self) -> String
pub fn to_rfc2822(&self) -> String
pub fn format(&self, pattern: &str) -> String
pub fn as_datetime(&self) -> &DateTime<Utc>
Trait Implementations§
Source§impl Clone for TimeSnapshot
impl Clone for TimeSnapshot
Source§fn clone(&self) -> TimeSnapshot
fn clone(&self) -> TimeSnapshot
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 TimeSnapshot
impl Debug for TimeSnapshot
Source§impl Display for TimeSnapshot
impl Display for TimeSnapshot
Source§impl Ord for TimeSnapshot
impl Ord for TimeSnapshot
Source§fn cmp(&self, other: &TimeSnapshot) -> Ordering
fn cmp(&self, other: &TimeSnapshot) -> 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 TimeSnapshot
impl PartialEq for TimeSnapshot
Source§fn eq(&self, other: &TimeSnapshot) -> bool
fn eq(&self, other: &TimeSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TimeSnapshot
impl PartialOrd for TimeSnapshot
impl Eq for TimeSnapshot
impl StructuralPartialEq for TimeSnapshot
Auto Trait Implementations§
impl Freeze for TimeSnapshot
impl RefUnwindSafe for TimeSnapshot
impl Send for TimeSnapshot
impl Sync for TimeSnapshot
impl Unpin for TimeSnapshot
impl UnsafeUnpin for TimeSnapshot
impl UnwindSafe for TimeSnapshot
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