Struct concordium_std::Duration [−][src]
#[repr(transparent)]pub struct Duration { /* fields omitted */ }
Expand description
Duration of time in milliseconds.
Negative durations are not allowed.
Implementations
Construct duration from milliseconds.
Construct duration from seconds.
Construct duration from minutes.
Construct duration from hours.
Add duration. Returns None
instead of overflowing.
Subtract duration. Returns None
instead of overflowing.
Trait Implementations
Parse a string containing a list of duration measures separated by whitespaces. A measure is a number followed by the unit (no whitespace between is allowed). Every measure is accumulated into a duration. The string is allowed to contain any number of measures with the same unit in no particular order.
The supported units are:
ms
for millisecondss
for secondsm
for minutesh
for hoursd
for days
Example
The duration of 10 days, 1 hour, 2minutes and 7 seconds is:
"10d 1h 2m 3s 4s"
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl UnwindSafe for Duration
Blanket Implementations
Mutably borrows from an owned value. Read more