pub struct Time {
pub days: u64,
pub hours: u8,
pub minutes: u8,
pub seconds: f64,
}
Expand description
Represents a time duration split into days, hours, minutes, and seconds.
This struct holds the components of a time duration for formatting and display.
Fields§
§days: u64
§hours: u8
§minutes: u8
§seconds: f64
Implementations§
Source§impl Time
impl Time
Sourcepub fn format_time(&self) -> String
pub fn format_time(&self) -> String
Formats the time elapsed into a human-readable string.
This method combines the time components (days, hours, minutes, seconds) into a single formatted string. It includes only non-zero components and always displays seconds.
§Returns
A formatted time string.
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin 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