3 use crate::{progress::Step, unit::DisplayValue}
;
5 /// A marker for formatting numbers as duration in renderers, as in `7d4h20m10s`.
6 #[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
9 impl DisplayValue
for Duration
{
10 fn display_current_value(&self, w
: &mut dyn fmt
::Write
, value
: Step
, _upper
: Option
<Step
>) -> fmt
::Result
{
11 w
.write_str(&compound_duration
::format_dhms(value
))
13 fn separator(&self, w
: &mut dyn fmt
::Write
, _value
: Step
, _upper
: Option
<Step
>) -> fmt
::Result
{
16 fn display_upper_bound(&self, w
: &mut dyn fmt
::Write
, upper_bound
: Step
, _value
: Step
) -> fmt
::Result
{
17 w
.write_str(&compound_duration
::format_dhms(upper_bound
))
20 fn dyn_hash(&self, state
: &mut dyn std
::hash
::Hasher
) {
24 fn display_unit(&self, _w
: &mut dyn fmt
::Write
, _value
: Step
) -> fmt
::Result
{