pub struct LocalTime { /* private fields */ }
Expand description
Local time.
This clock is monotonic.
Implementations§
Source§impl LocalTime
impl LocalTime
Sourcepub const fn from_secs(secs: u64) -> LocalTime
pub const fn from_secs(secs: u64) -> LocalTime
Construct a local time from whole seconds since Epoch.
Sourcepub const fn from_millis(millis: u128) -> LocalTime
pub const fn from_millis(millis: u128) -> LocalTime
Construct a local time from milliseconds since Epoch.
Sourcepub fn duration_since(&self, earlier: LocalTime) -> LocalDuration
pub fn duration_since(&self, earlier: LocalTime) -> LocalDuration
Get the duration since the given time.
§Panics
This function will panic if earlier
is later than self
.
Sourcepub fn diff(&self, other: LocalTime) -> LocalDuration
pub fn diff(&self, other: LocalTime) -> LocalDuration
Get the difference between two times.
Sourcepub fn elapse(&mut self, duration: LocalDuration)
pub fn elapse(&mut self, duration: LocalDuration)
Elapse time.
Adds the given duration to the time.
Trait Implementations§
Source§impl Add<LocalDuration> for LocalTime
Add a duration to a local time. Yields a local time.
impl Add<LocalDuration> for LocalTime
Add a duration to a local time. Yields a local time.
Source§impl<'de> Deserialize<'de> for LocalTime
impl<'de> Deserialize<'de> for LocalTime
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SystemTime> for LocalTime
Convert a SystemTime
into a local time.
impl From<SystemTime> for LocalTime
Convert a SystemTime
into a local time.
Source§fn from(system: SystemTime) -> LocalTime
fn from(system: SystemTime) -> LocalTime
Converts to this type from the input type.
Source§impl Ord for LocalTime
impl Ord for LocalTime
Source§impl PartialOrd for LocalTime
impl PartialOrd for LocalTime
Source§impl Serialize for LocalTime
impl Serialize for LocalTime
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Sub<LocalDuration> for LocalTime
Substract a duration from a local time. Yields a local time.
impl Sub<LocalDuration> for LocalTime
Substract a duration from a local time. Yields a local time.
Source§impl Sub for LocalTime
Substract two local times. Yields a duration.
impl Sub for LocalTime
Substract two local times. Yields a duration.
Source§type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
-
operator.impl Copy for LocalTime
impl Eq for LocalTime
impl StructuralPartialEq for LocalTime
Auto Trait Implementations§
impl Freeze for LocalTime
impl RefUnwindSafe for LocalTime
impl Send for LocalTime
impl Sync for LocalTime
impl Unpin for LocalTime
impl UnwindSafe for LocalTime
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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