doc.rust-lang.org
pub const fn is_zero(&self) -> bool
Returns true if this Duration spans no time.
method
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_secs_f64(secs: f64) -> Duration
Creates a new Duration from the specified number of seconds represented as f64.
associated_function
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_secs_f32(secs: f32) -> Duration
Creates a new Duration from the specified number of seconds represented as f32.
associated_function
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_secs(secs: u64) -> Duration
Creates a new Duration from the specified number of whole seconds.
associated_function
core
Stable since 1.3.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_nanos_u128(nanos: u128) -> Duration
Creates a new Duration from the specified number of nanoseconds.
associated_function
core
Stable since 1.93.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_nanos(nanos: u64) -> Duration
Creates a new Duration from the specified number of nanoseconds.
associated_function
core
Stable since 1.27.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_mins(mins: u64) -> Duration
Creates a new Duration from the specified number of minutes.
associated_function
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_millis(millis: u64) -> Duration
Creates a new Duration from the specified number of milliseconds.
associated_function
core
Stable since 1.3.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_micros(micros: u64) -> Duration
Creates a new Duration from the specified number of microseconds.
associated_function
core
Stable since 1.27.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_hours(hours: u64) -> Duration
Creates a new Duration from the specified number of hours.
associated_function
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn div_f64(self, rhs: f64) -> Duration
Divides Duration by f64.
method
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn div_f32(self, rhs: f32) -> Duration
Divides Duration by f32.
method
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn div_duration_f64(self, rhs: Duration) -> f64
Divides Duration by Duration and returns f64.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn div_duration_f32(self, rhs: Duration) -> f32
Divides Duration by Duration and returns f32.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_sub(self, rhs: Duration) -> Option<Duration>
Checked Duration subtraction. Computes self - other, returning None if the result would be negative or if overflow occurred.
method
core
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_mul(self, rhs: u32) -> Option<Duration>
Checked Duration multiplication. Computes self * other, returning None if overflow occurred.
method
core
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_div(self, rhs: u32) -> Option<Duration>
Checked Duration division. Computes self / other, returning None if other == 0.
method
core
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_add(self, rhs: Duration) -> Option<Duration>
Checked Duration addition. Computes self + other, returning None if overflow occurred.
method
core
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_secs_f64(&self) -> f64
Returns the number of seconds contained by this Duration as f64.
method
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_secs_f32(&self) -> f32
Returns the number of seconds contained by this Duration as f32.
method
core
Stable since 1.38.0
Version 1.100.0-nightly