Struct wall_clock::WallClockTime
source · pub struct WallClockTime { /* private fields */ }Expand description
A representation of a time, as read from a wall clock, independent of date or time zone.
Implementations§
source§impl WallClockTime
impl WallClockTime
sourcepub const fn new(hours: u8, minutes: u8, seconds: u8) -> Self
pub const fn new(hours: u8, minutes: u8, seconds: u8) -> Self
A new wall-clock time set to the provided hours, minutes, and seconds.
§Panic
Panics if any values are too high for a wall clock (hours >= 24, minutes >= 60, seconds >= 60). Wall clocks don’t know about leap seconds.
sourcepub const fn new_with_micros(
hours: u8,
minutes: u8,
seconds: u8,
micros: u32
) -> Self
pub const fn new_with_micros( hours: u8, minutes: u8, seconds: u8, micros: u32 ) -> Self
A new wall-clock time set to the provided hours, minutes, seconds, and microseconds.
§Panic
Panics if any values are too high for a wall clock (hours >= 24, minutes >= 60, seconds >= 60). Wall clocks don’t know about leap seconds.
sourcepub const fn new_midnight_offset(seconds: u32, micros: u32) -> Self
pub const fn new_midnight_offset(seconds: u32, micros: u32) -> Self
A new wall-clock time corresponding to the number of seconds and microseconds offset from midnight.
§Panic
Panics if any values are higher than is valid for a wall clock (seconds >= 86,400; micros >= 1,000,000).
sourcepub const fn microsecond(&self) -> u32
pub const fn microsecond(&self) -> u32
The number of microseconds since the last second.
Trait Implementations§
source§impl Clone for WallClockTime
impl Clone for WallClockTime
source§fn clone(&self) -> WallClockTime
fn clone(&self) -> WallClockTime
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for WallClockTime
impl Debug for WallClockTime
source§impl Default for WallClockTime
impl Default for WallClockTime
source§fn default() -> WallClockTime
fn default() -> WallClockTime
source§impl<'de> Deserialize<'de> for WallClockTime
impl<'de> Deserialize<'de> for WallClockTime
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
source§impl Display for WallClockTime
impl Display for WallClockTime
source§impl FromStr for WallClockTime
impl FromStr for WallClockTime
source§impl Ord for WallClockTime
impl Ord for WallClockTime
source§fn cmp(&self, other: &WallClockTime) -> Ordering
fn cmp(&self, other: &WallClockTime) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for WallClockTime
impl PartialEq for WallClockTime
source§fn eq(&self, other: &WallClockTime) -> bool
fn eq(&self, other: &WallClockTime) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for WallClockTime
impl PartialOrd for WallClockTime
source§fn partial_cmp(&self, other: &WallClockTime) -> Option<Ordering>
fn partial_cmp(&self, other: &WallClockTime) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more