pub struct Time { /* private fields */ }Expand description
A wall-clock time representation (hours, minutes, seconds, milliseconds).
Implementations§
Source§impl Time
impl Time
Sourcepub fn from_hms(hour: u8, minute: u8, second: u8) -> Result<Time, DateTimeError>
pub fn from_hms(hour: u8, minute: u8, second: u8) -> Result<Time, DateTimeError>
Create and validate a time with second precision.
§Errors
Returns DateTimeError if any component is out of bounds.
Sourcepub fn from_hms_milli(
hour: u8,
minute: u8,
second: u8,
millisecond: u16,
) -> Result<Time, DateTimeError>
pub fn from_hms_milli( hour: u8, minute: u8, second: u8, millisecond: u16, ) -> Result<Time, DateTimeError>
Create and validate a time with millisecond precision.
§Errors
Returns DateTimeError if any component is out of bounds.
Sourcepub const fn millisecond(&self) -> u16
pub const fn millisecond(&self) -> u16
Millisecond (0..=999).
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