[−][src]Struct uhr::uhr::Uhr
A clock representing wall-clock-time. Not guaranteed to be monotonic. Time is stored referenced to epoch/UTC time, and a time zone offset may be provided to determine local time
Methods
impl Uhr
[src]
pub fn increment(&mut self, dur: &Duration)
[src]
Increment the current clock by a duration
pub fn incremented(&self, dur: &Duration) -> Uhr
[src]
Create a new clock time at a time dur
after the current time
pub fn try_duration_since(&self, before: &Uhr) -> Result<Duration, ()>
[src]
Obtain the duration since a given time. An error is returned if the before time is after now
pub fn duration_since(&self, before: &Uhr) -> Duration
[src]
Obtain the duration since a given time. This function panics if before
is after the current time. Consider using try_duration_since()
pub fn into_local_date_time(&self) -> DateTime<FixedOffsetFromUtc>
[src]
Convert the current wall clock into a local DateTime
object
pub fn set_local_time_zone(&mut self, offset: FixedOffsetFromUtc)
[src]
Change the local timezone of the clock
Trait Implementations
impl Copy for Uhr
[src]
impl Debug for Uhr
[src]
impl PartialEq<Uhr> for Uhr
[src]
impl Eq for Uhr
[src]
impl Ord for Uhr
[src]
fn cmp(&self, other: &Uhr) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more
impl PartialOrd<Uhr> for Uhr
[src]
fn partial_cmp(&self, other: &Uhr) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl From<UnixTimestamp> for Uhr
[src]
fn from(uts: UnixTimestamp) -> Self
[src]
impl<ALARMS> From<Uhr> for Wecker<ALARMS> where
ALARMS: ArrayLength<Alarm>,
[src]
ALARMS: ArrayLength<Alarm>,
impl Clone for Uhr
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self