pub trait TimeDeltaExt {
// Required methods
fn to_hm_string(&self) -> String;
fn total_hours(&self) -> f32;
}Expand description
Functions to simplify the handling of TimeDelta
Required Methods§
fn to_hm_string(&self) -> String
fn total_hours(&self) -> f32
Implementations on Foreign Types§
Source§impl TimeDeltaExt for TimeDelta
impl TimeDeltaExt for TimeDelta
Source§fn to_hm_string(&self) -> String
fn to_hm_string(&self) -> String
Turn a TimeDelta into a string of the format "00h 00m".
§Example
let delta = TimeDelta::hours(1) + TimeDelta::minutes(2) + TimeDelta::seconds(3);
assert_eq!(delta.to_hm_string(), "01h 02m");Source§fn total_hours(&self) -> f32
fn total_hours(&self) -> f32
Get the total hours, minutes and seconds of a TimeDelta as a String.