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) -> Self
pub const fn from_secs(secs: u64) -> Self
Construct a local time from whole seconds 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 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) -> Self
fn from(system: SystemTime) -> Self
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 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