pub struct Time {
pub hour: i64,
pub minute: i64,
pub second: i64,
}Expand description
A time of day with second precision.
Fields§
§hour: i64§minute: i64§second: i64Implementations§
Source§impl Time
impl Time
pub const MIN: Self
pub const MAX: Self
pub fn new(hour: i64, minute: i64, second: i64) -> Option<Self>
Sourcepub fn parse_iso(text: &str) -> Option<Self>
pub fn parse_iso(text: &str) -> Option<Self>
Parse an ASCII time of day, with optional seconds.
pub fn format_iso(self, show_seconds: bool) -> String
pub fn in_range(self, minimum: Self, maximum: Self) -> bool
pub fn normalized(self) -> Self
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 Forget for Time
impl Freeze for Time
impl Move 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