Struct friendly::temporal::HumanDuration[][src]

pub struct HumanDuration { /* fields omitted */ }
Expand description

Human-displayable durations (from Duration).

There are two settings to tweak on a displayable duration:

  • Whether it is full (“3 hours 2 minutes 3.42 seconds”) or compact (“2h2m3.42s”)
  • How many components are displayed (e.g. with 3 parts, “5d3h2m” will omit seconds)

The default is compact display with 3 parts.

Implementations

Create a new readable duration from seconds.

Set whether display is compact.

Set the number of parts to display (0 for all).

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.