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 fn parse(
time_str: impl AsRef<str>,
time_fmt: &'static str,
) -> ParseResult<Self>
pub fn parse( time_str: impl AsRef<str>, time_fmt: &'static str, ) -> ParseResult<Self>
Parse a wall clock time from a string. Any date components are ignored.
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 more