pub trait ToDuration {
// Required methods
fn to_duration(&self) -> TimeDelta;
fn to_duration_ceil_nanos(&self) -> TimeDelta;
}Expand description
Convert a Decimal amount of hours to a TimeDelta.
Required Methods§
Sourcefn to_duration(&self) -> TimeDelta
fn to_duration(&self) -> TimeDelta
Convert a Decimal amount of hours to a TimeDelta.
Sourcefn to_duration_ceil_nanos(&self) -> TimeDelta
fn to_duration_ceil_nanos(&self) -> TimeDelta
Convert a Decimal amount of hours to a TimeDelta.
Ceil the number of nanoseconds up to avoid exceeding max_power.
Implementations on Foreign Types§
Source§impl ToDuration for Decimal
impl ToDuration for Decimal
Source§fn to_duration(&self) -> TimeDelta
fn to_duration(&self) -> TimeDelta
Convert a Decimal amount of hours to a TimeDelta.
Round to the maximal precision of TimeDelta which is nanoseconds.
Source§fn to_duration_ceil_nanos(&self) -> TimeDelta
fn to_duration_ceil_nanos(&self) -> TimeDelta
Convert a Decimal amount of hours to a TimeDelta.
Use the maximal precision of TimeDelta which is nanoseconds,
using ceil to avoid exceeding max_power.