pub struct TimeHms { /* private fields */ }Expand description
TimeHms parses a duration in seconds to a more human-readable representation in hours, minutes and seconds.
use time_hms::TimeHms;
let t = TimeHms::new(3723);
// 3723 seconds equal 1 hour, 2 minutes and 3 seconds
assert_eq!(t.h(), 1);
assert_eq!(t.m(), 2);
assert_eq!(t.s(), 3);
// A default way to format! / println! is included
assert_eq!(format!("{}", t), "01:02:03")Implementations§
Trait Implementations§
impl StructuralPartialEq for TimeHms
Auto Trait Implementations§
impl Freeze for TimeHms
impl RefUnwindSafe for TimeHms
impl Send for TimeHms
impl Sync for TimeHms
impl Unpin for TimeHms
impl UnwindSafe for TimeHms
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