Struct local_clock::LocalClockTime
source · pub struct LocalClockTime { /* private fields */ }
Expand description
An opaque type, representing an instant in time.
This type doesn’t expose a particularly “rich” API for working the the
contained time. Rather, consumers of this type are expected to us it
alongside an external time/date library (such as time
or chrono
) in
order to more easily manipulate time/date values.
Implementations§
source§impl LocalClockTime
impl LocalClockTime
sourcepub fn as_millis_since_unix_epoch(&self) -> i64
pub fn as_millis_since_unix_epoch(&self) -> i64
Return the number of millis since the Unix Epoch (in UTC).
Also see: std::time::UNIX_EPOCH
sourcepub fn from_millis_since_unix_epoch(millis: i64) -> Self
pub fn from_millis_since_unix_epoch(millis: i64) -> Self
Create a new LocalClockTime
containing the time some number of
millis offset from the Unix Epoch (in UTC).
Also see: std::time::UNIX_EPOCH
Trait Implementations§
source§impl Add<LocalClockDelta> for LocalClockTime
impl Add<LocalClockDelta> for LocalClockTime
source§type Output = LocalClockTime
type Output = LocalClockTime
The resulting type after applying the
+
operator.source§impl Clone for LocalClockTime
impl Clone for LocalClockTime
source§fn clone(&self) -> LocalClockTime
fn clone(&self) -> LocalClockTime
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 LocalClockTime
impl Debug for LocalClockTime
source§impl Default for LocalClockTime
impl Default for LocalClockTime
source§fn default() -> LocalClockTime
fn default() -> LocalClockTime
Returns the “default value” for a type. Read more
source§impl From<LocalClockTime> for SystemTime
impl From<LocalClockTime> for SystemTime
source§fn from(clock_time: LocalClockTime) -> Self
fn from(clock_time: LocalClockTime) -> Self
Converts to this type from the input type.
source§impl From<OffsetDateTime> for LocalClockTime
impl From<OffsetDateTime> for LocalClockTime
source§fn from(date_time: OffsetDateTime) -> LocalClockTime
fn from(date_time: OffsetDateTime) -> LocalClockTime
Converts to this type from the input type.
source§impl From<SystemTime> for LocalClockTime
impl From<SystemTime> for LocalClockTime
source§fn from(sys_time: SystemTime) -> Self
fn from(sys_time: SystemTime) -> Self
Converts to this type from the input type.
source§impl Hash for LocalClockTime
impl Hash for LocalClockTime
source§impl Inspect for LocalClockTime
impl Inspect for LocalClockTime
source§impl Ord for LocalClockTime
impl Ord for LocalClockTime
source§fn cmp(&self, other: &LocalClockTime) -> Ordering
fn cmp(&self, other: &LocalClockTime) -> 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 for LocalClockTime
impl PartialEq for LocalClockTime
source§impl PartialOrd for LocalClockTime
impl PartialOrd for LocalClockTime
source§impl Sub<LocalClockDelta> for LocalClockTime
impl Sub<LocalClockDelta> for LocalClockTime
source§type Output = LocalClockTime
type Output = LocalClockTime
The resulting type after applying the
-
operator.source§impl Sub for LocalClockTime
impl Sub for LocalClockTime
source§impl TryFrom<LocalClockTime> for OffsetDateTime
impl TryFrom<LocalClockTime> for OffsetDateTime
source§type Error = OverflowError
type Error = OverflowError
The type returned in the event of a conversion error.
impl Copy for LocalClockTime
impl Eq for LocalClockTime
impl StructuralPartialEq for LocalClockTime
Auto Trait Implementations§
impl Freeze for LocalClockTime
impl RefUnwindSafe for LocalClockTime
impl Send for LocalClockTime
impl Sync for LocalClockTime
impl Unpin for LocalClockTime
impl UnwindSafe for LocalClockTime
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)