pub struct Time { /* private fields */ }Expand description
A wall-clock time, to the millisecond (a date/time literal has at most three fraction digits).
Implementations§
Source§impl Time
impl Time
Sourcepub const fn new(
hour: u8,
minute: u8,
second: u8,
millisecond: u16,
) -> Option<Time>
pub const fn new( hour: u8, minute: u8, second: u8, millisecond: u16, ) -> Option<Time>
hour:minute:second.millisecond; None unless 0–23, 0–59, 0–59,
0–999.
Sourcepub const fn millisecond(self) -> u16
pub const fn millisecond(self) -> u16
The millisecond, 0–999.
Sourcepub const fn from_ms_of_day(ms: i64) -> Option<Time>
pub const fn from_ms_of_day(ms: i64) -> Option<Time>
The time ms milliseconds after midnight (0 ≤ ms < 86,400,000).
Trait Implementations§
impl Copy for Time
impl Eq for Time
Source§impl Ord for Time
impl Ord for Time
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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