pub struct Duration<T, const NOM: u32, const DENOM: u32> { /* private fields */ }
Expand description
Represents a duration of time.
The generic T
can either be u32
or u64
, and the const generics represent the ratio of the
ticks contained within the duration: duration in seconds = NOM / DENOM * ticks
Implementations§
source§impl<const NOM: u32, const DENOM: u32> Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Duration<u32, NOM, DENOM>
sourcepub const fn from_ticks(ticks: u32) -> Self
pub const fn from_ticks(ticks: u32) -> Self
Create a Duration
from a ticks value.
let _d = Duration::<u32, 1, 1_000>::from_ticks(1);
sourcepub const fn ticks(&self) -> u32
pub const fn ticks(&self) -> u32
Extract the ticks from a Duration
.
let d = Duration::<u32, 1, 1_000>::from_ticks(234);
assert_eq!(d.ticks(), 234);
sourcepub const fn is_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
Returns true if this Duration
spans no time
let zero = Duration::<u32, 1, 1_000>::from_ticks(0);
let one = Duration::<u32, 1, 1_000>::from_ticks(1);
assert_eq!(zero.is_zero(), true);
assert_eq!(one.is_zero(), false);
sourcepub const fn checked_add<const O_NOM: u32, const O_DENOM: u32>(
self,
other: Duration<u32, O_NOM, O_DENOM>,
) -> Option<Self>
pub const fn checked_add<const O_NOM: u32, const O_DENOM: u32>( self, other: Duration<u32, O_NOM, O_DENOM>, ) -> Option<Self>
Add two durations while checking for overflow.
let d1 = Duration::<u32, 1, 1_000>::from_ticks(1);
let d2 = Duration::<u32, 1, 1_000>::from_ticks(2);
let d3 = Duration::<u32, 1, 1_000>::from_ticks(u32::MAX);
assert_eq!(d1.checked_add(d2).unwrap().ticks(), 3);
assert_eq!(d1.checked_add(d3), None);
sourcepub const fn checked_sub<const O_NOM: u32, const O_DENOM: u32>(
self,
other: Duration<u32, O_NOM, O_DENOM>,
) -> Option<Self>
pub const fn checked_sub<const O_NOM: u32, const O_DENOM: u32>( self, other: Duration<u32, O_NOM, O_DENOM>, ) -> Option<Self>
Subtract two durations while checking for overflow.
let d1 = Duration::<u32, 1, 1_000>::from_ticks(1);
let d2 = Duration::<u32, 1, 1_000>::from_ticks(2);
let d3 = Duration::<u32, 1, 1_000>::from_ticks(u32::MAX);
assert_eq!(d2.checked_sub(d1).unwrap().ticks(), 1);
assert_eq!(d1.checked_sub(d3), None);
sourcepub const fn const_partial_cmp<const R_NOM: u32, const R_DENOM: u32>(
self,
other: Duration<u32, R_NOM, R_DENOM>,
) -> Option<Ordering>
pub const fn const_partial_cmp<const R_NOM: u32, const R_DENOM: u32>( self, other: Duration<u32, R_NOM, R_DENOM>, ) -> Option<Ordering>
Const partial comparison.
let d1 = Duration::<u32, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u32, 1, 1_000>::from_ticks(1);
assert_eq!(d1.const_partial_cmp(d2), Some(core::cmp::Ordering::Greater));
sourcepub const fn const_eq<const R_NOM: u32, const R_DENOM: u32>(
self,
other: Duration<u32, R_NOM, R_DENOM>,
) -> bool
pub const fn const_eq<const R_NOM: u32, const R_DENOM: u32>( self, other: Duration<u32, R_NOM, R_DENOM>, ) -> bool
Const equality check.
let d1 = Duration::<u32, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u32, 1, 1_000>::from_ticks(10);
assert!(d1.const_eq(d2));
sourcepub const fn const_try_from<const I_NOM: u32, const I_DENOM: u32>(
duration: Duration<u32, I_NOM, I_DENOM>,
) -> Option<Self>
pub const fn const_try_from<const I_NOM: u32, const I_DENOM: u32>( duration: Duration<u32, I_NOM, I_DENOM>, ) -> Option<Self>
Const try from, checking for overflow.
let d1 = Duration::<u32, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u32, 1, 1_000>::const_try_from(d1);
assert_eq!(d2.unwrap().ticks(), 10);
sourcepub const fn const_try_into<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Option<Duration<u32, O_NOM, O_DENOM>>
pub const fn const_try_into<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Option<Duration<u32, O_NOM, O_DENOM>>
Const try into, checking for overflow.
let d1 = Duration::<u32, 1, 1_00>::from_ticks(1);
let d2: Option<Duration::<u32, 1, 1_000>> = d1.const_try_into();
assert_eq!(d2.unwrap().ticks(), 10);
sourcepub const fn try_into_rate<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Option<Rate<u32, O_NOM, O_DENOM>>
pub const fn try_into_rate<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Option<Rate<u32, O_NOM, O_DENOM>>
Const try into rate, checking for divide-by-zero.
let d1 = Duration::<u32, 1, 1_000>::from_ticks(2);
let r1: Option<Rate::<u32, 1, 1>> = d1.try_into_rate();
assert_eq!(r1.unwrap().raw(), 500);
sourcepub const fn into_rate<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Rate<u32, O_NOM, O_DENOM>
pub const fn into_rate<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Rate<u32, O_NOM, O_DENOM>
Convert from duration to rate.
sourcepub const fn try_from_rate<const I_NOM: u32, const I_DENOM: u32>(
rate: Rate<u32, I_NOM, I_DENOM>,
) -> Option<Self>
pub const fn try_from_rate<const I_NOM: u32, const I_DENOM: u32>( rate: Rate<u32, I_NOM, I_DENOM>, ) -> Option<Self>
Const try from rate, checking for divide-by-zero.
let r1 = Rate::<u32, 1, 1>::from_raw(1);
let d1 = Duration::<u32, 1, 1_000>::try_from_rate(r1);
assert_eq!(d1.unwrap().ticks(), 1_000);
sourcepub const fn from_rate<const I_NOM: u32, const I_DENOM: u32>(
rate: Rate<u32, I_NOM, I_DENOM>,
) -> Self
pub const fn from_rate<const I_NOM: u32, const I_DENOM: u32>( rate: Rate<u32, I_NOM, I_DENOM>, ) -> Self
Convert from rate to duration.
sourcepub const fn convert<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Duration<u32, O_NOM, O_DENOM>
pub const fn convert<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Duration<u32, O_NOM, O_DENOM>
Convert between bases for a duration.
Unfortunately not a From
impl due to collision with the std lib.
let d1 = Duration::<u32, 1, 100>::from_ticks(1);
let d2: Duration::<u32, 1, 1_000> = d1.convert();
assert_eq!(d2.ticks(), 10);
Can be used in const contexts. Compilation will fail if the conversion causes overflow
const TICKS: u32= u32::MAX - 10;
const D1: Duration::<u32, 1, 100> = Duration::<u32, 1, 100>::from_ticks(TICKS);
// Fails conversion due to tick overflow
const D2: Duration::<u32, 1, 200> = D1.convert();
sourcepub const fn nanos(val: u32) -> Self
pub const fn nanos(val: u32) -> Self
Shorthand for creating a duration which represents nanoseconds.
sourcepub const fn nanos_at_least(val: u32) -> Self
pub const fn nanos_at_least(val: u32) -> Self
Shorthand for creating a duration which represents nanoseconds (ceil rounded).
sourcepub const fn to_micros(&self) -> u32
pub const fn to_micros(&self) -> u32
Convert the Duration to an integer number of microseconds.
sourcepub const fn micros(val: u32) -> Self
pub const fn micros(val: u32) -> Self
Shorthand for creating a duration which represents microseconds.
sourcepub const fn micros_at_least(val: u32) -> Self
pub const fn micros_at_least(val: u32) -> Self
Shorthand for creating a duration which represents microseconds (ceil rounded).
sourcepub const fn to_millis(&self) -> u32
pub const fn to_millis(&self) -> u32
Convert the Duration to an integer number of milliseconds.
sourcepub const fn millis(val: u32) -> Self
pub const fn millis(val: u32) -> Self
Shorthand for creating a duration which represents milliseconds.
sourcepub const fn millis_at_least(val: u32) -> Self
pub const fn millis_at_least(val: u32) -> Self
Shorthand for creating a duration which represents milliseconds (ceil rounded).
sourcepub const fn secs(val: u32) -> Self
pub const fn secs(val: u32) -> Self
Shorthand for creating a duration which represents seconds.
sourcepub const fn secs_at_least(val: u32) -> Self
pub const fn secs_at_least(val: u32) -> Self
Shorthand for creating a duration which represents seconds (ceil rounded).
sourcepub const fn to_minutes(&self) -> u32
pub const fn to_minutes(&self) -> u32
Convert the Duration to an integer number of minutes.
sourcepub const fn minutes(val: u32) -> Self
pub const fn minutes(val: u32) -> Self
Shorthand for creating a duration which represents minutes.
sourcepub const fn minutes_at_least(val: u32) -> Self
pub const fn minutes_at_least(val: u32) -> Self
Shorthand for creating a duration which represents minutes (ceil rounded).
sourcepub const fn hours_at_least(val: u32) -> Self
pub const fn hours_at_least(val: u32) -> Self
Shorthand for creating a duration which represents hours (ceil rounded).
source§impl<const NOM: u32, const DENOM: u32> Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Duration<u64, NOM, DENOM>
sourcepub const fn from_ticks(ticks: u64) -> Self
pub const fn from_ticks(ticks: u64) -> Self
Create a Duration
from a ticks value.
let _d = Duration::<u64, 1, 1_000>::from_ticks(1);
sourcepub const fn ticks(&self) -> u64
pub const fn ticks(&self) -> u64
Extract the ticks from a Duration
.
let d = Duration::<u64, 1, 1_000>::from_ticks(234);
assert_eq!(d.ticks(), 234);
sourcepub const fn is_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
Returns true if this Duration
spans no time
let zero = Duration::<u64, 1, 1_000>::from_ticks(0);
let one = Duration::<u64, 1, 1_000>::from_ticks(1);
assert_eq!(zero.is_zero(), true);
assert_eq!(one.is_zero(), false);
sourcepub const fn checked_add<const O_NOM: u32, const O_DENOM: u32>(
self,
other: Duration<u64, O_NOM, O_DENOM>,
) -> Option<Self>
pub const fn checked_add<const O_NOM: u32, const O_DENOM: u32>( self, other: Duration<u64, O_NOM, O_DENOM>, ) -> Option<Self>
Add two durations while checking for overflow.
let d1 = Duration::<u64, 1, 1_000>::from_ticks(1);
let d2 = Duration::<u64, 1, 1_000>::from_ticks(2);
let d3 = Duration::<u64, 1, 1_000>::from_ticks(u64::MAX);
assert_eq!(d1.checked_add(d2).unwrap().ticks(), 3);
assert_eq!(d1.checked_add(d3), None);
sourcepub const fn checked_sub<const O_NOM: u32, const O_DENOM: u32>(
self,
other: Duration<u64, O_NOM, O_DENOM>,
) -> Option<Self>
pub const fn checked_sub<const O_NOM: u32, const O_DENOM: u32>( self, other: Duration<u64, O_NOM, O_DENOM>, ) -> Option<Self>
Subtract two durations while checking for overflow.
let d1 = Duration::<u64, 1, 1_000>::from_ticks(1);
let d2 = Duration::<u64, 1, 1_000>::from_ticks(2);
let d3 = Duration::<u64, 1, 1_000>::from_ticks(u64::MAX);
assert_eq!(d2.checked_sub(d1).unwrap().ticks(), 1);
assert_eq!(d1.checked_sub(d3), None);
sourcepub const fn const_partial_cmp<const R_NOM: u32, const R_DENOM: u32>(
self,
other: Duration<u64, R_NOM, R_DENOM>,
) -> Option<Ordering>
pub const fn const_partial_cmp<const R_NOM: u32, const R_DENOM: u32>( self, other: Duration<u64, R_NOM, R_DENOM>, ) -> Option<Ordering>
Const partial comparison.
let d1 = Duration::<u64, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u64, 1, 1_000>::from_ticks(1);
assert_eq!(d1.const_partial_cmp(d2), Some(core::cmp::Ordering::Greater));
sourcepub const fn const_eq<const R_NOM: u32, const R_DENOM: u32>(
self,
other: Duration<u64, R_NOM, R_DENOM>,
) -> bool
pub const fn const_eq<const R_NOM: u32, const R_DENOM: u32>( self, other: Duration<u64, R_NOM, R_DENOM>, ) -> bool
Const equality check.
let d1 = Duration::<u64, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u64, 1, 1_000>::from_ticks(10);
assert!(d1.const_eq(d2));
sourcepub const fn const_try_from<const I_NOM: u32, const I_DENOM: u32>(
duration: Duration<u64, I_NOM, I_DENOM>,
) -> Option<Self>
pub const fn const_try_from<const I_NOM: u32, const I_DENOM: u32>( duration: Duration<u64, I_NOM, I_DENOM>, ) -> Option<Self>
Const try from, checking for overflow.
let d1 = Duration::<u64, 1, 1_00>::from_ticks(1);
let d2 = Duration::<u64, 1, 1_000>::const_try_from(d1);
assert_eq!(d2.unwrap().ticks(), 10);
sourcepub const fn const_try_into<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Option<Duration<u64, O_NOM, O_DENOM>>
pub const fn const_try_into<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Option<Duration<u64, O_NOM, O_DENOM>>
Const try into, checking for overflow.
let d1 = Duration::<u64, 1, 1_00>::from_ticks(1);
let d2: Option<Duration::<u64, 1, 1_000>> = d1.const_try_into();
assert_eq!(d2.unwrap().ticks(), 10);
sourcepub const fn try_into_rate<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Option<Rate<u64, O_NOM, O_DENOM>>
pub const fn try_into_rate<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Option<Rate<u64, O_NOM, O_DENOM>>
Const try into rate, checking for divide-by-zero.
let d1 = Duration::<u64, 1, 1_000>::from_ticks(2);
let r1: Option<Rate::<u64, 1, 1>> = d1.try_into_rate();
assert_eq!(r1.unwrap().raw(), 500);
sourcepub const fn into_rate<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Rate<u64, O_NOM, O_DENOM>
pub const fn into_rate<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Rate<u64, O_NOM, O_DENOM>
Convert from duration to rate.
sourcepub const fn try_from_rate<const I_NOM: u32, const I_DENOM: u32>(
rate: Rate<u64, I_NOM, I_DENOM>,
) -> Option<Self>
pub const fn try_from_rate<const I_NOM: u32, const I_DENOM: u32>( rate: Rate<u64, I_NOM, I_DENOM>, ) -> Option<Self>
Const try from rate, checking for divide-by-zero.
let r1 = Rate::<u64, 1, 1>::from_raw(1);
let d1 = Duration::<u64, 1, 1_000>::try_from_rate(r1);
assert_eq!(d1.unwrap().ticks(), 1_000);
sourcepub const fn from_rate<const I_NOM: u32, const I_DENOM: u32>(
rate: Rate<u64, I_NOM, I_DENOM>,
) -> Self
pub const fn from_rate<const I_NOM: u32, const I_DENOM: u32>( rate: Rate<u64, I_NOM, I_DENOM>, ) -> Self
Convert from rate to duration.
sourcepub const fn convert<const O_NOM: u32, const O_DENOM: u32>(
self,
) -> Duration<u64, O_NOM, O_DENOM>
pub const fn convert<const O_NOM: u32, const O_DENOM: u32>( self, ) -> Duration<u64, O_NOM, O_DENOM>
Convert between bases for a duration.
Unfortunately not a From
impl due to collision with the std lib.
let d1 = Duration::<u64, 1, 100>::from_ticks(1);
let d2: Duration::<u64, 1, 1_000> = d1.convert();
assert_eq!(d2.ticks(), 10);
Can be used in const contexts. Compilation will fail if the conversion causes overflow
const TICKS: u64= u64::MAX - 10;
const D1: Duration::<u64, 1, 100> = Duration::<u64, 1, 100>::from_ticks(TICKS);
// Fails conversion due to tick overflow
const D2: Duration::<u64, 1, 200> = D1.convert();
sourcepub const fn nanos(val: u64) -> Self
pub const fn nanos(val: u64) -> Self
Shorthand for creating a duration which represents nanoseconds.
sourcepub const fn nanos_at_least(val: u64) -> Self
pub const fn nanos_at_least(val: u64) -> Self
Shorthand for creating a duration which represents nanoseconds (ceil rounded).
sourcepub const fn to_micros(&self) -> u64
pub const fn to_micros(&self) -> u64
Convert the Duration to an integer number of microseconds.
sourcepub const fn micros(val: u64) -> Self
pub const fn micros(val: u64) -> Self
Shorthand for creating a duration which represents microseconds.
sourcepub const fn micros_at_least(val: u64) -> Self
pub const fn micros_at_least(val: u64) -> Self
Shorthand for creating a duration which represents microseconds (ceil rounded).
sourcepub const fn to_millis(&self) -> u64
pub const fn to_millis(&self) -> u64
Convert the Duration to an integer number of milliseconds.
sourcepub const fn millis(val: u64) -> Self
pub const fn millis(val: u64) -> Self
Shorthand for creating a duration which represents milliseconds.
sourcepub const fn millis_at_least(val: u64) -> Self
pub const fn millis_at_least(val: u64) -> Self
Shorthand for creating a duration which represents milliseconds (ceil rounded).
sourcepub const fn secs(val: u64) -> Self
pub const fn secs(val: u64) -> Self
Shorthand for creating a duration which represents seconds.
sourcepub const fn secs_at_least(val: u64) -> Self
pub const fn secs_at_least(val: u64) -> Self
Shorthand for creating a duration which represents seconds (ceil rounded).
sourcepub const fn to_minutes(&self) -> u64
pub const fn to_minutes(&self) -> u64
Convert the Duration to an integer number of minutes.
sourcepub const fn minutes(val: u64) -> Self
pub const fn minutes(val: u64) -> Self
Shorthand for creating a duration which represents minutes.
sourcepub const fn minutes_at_least(val: u64) -> Self
pub const fn minutes_at_least(val: u64) -> Self
Shorthand for creating a duration which represents minutes (ceil rounded).
sourcepub const fn hours_at_least(val: u64) -> Self
pub const fn hours_at_least(val: u64) -> Self
Shorthand for creating a duration which represents hours (ceil rounded).
Trait Implementations§
source§impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Add<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Add<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Add<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> AddAssign for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign for Duration<u32, NOM, DENOM>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> AddAssign for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> AddAssign for Duration<u64, NOM, DENOM>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moresource§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> Div<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> Div<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> Div<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> Div<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
source§impl<const NOM: u32, const DENOM: u32> DivAssign<u32> for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> DivAssign<u32> for Duration<u32, NOM, DENOM>
source§fn div_assign(&mut self, other: u32)
fn div_assign(&mut self, other: u32)
/=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> DivAssign<u32> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> DivAssign<u32> for Duration<u64, NOM, DENOM>
source§fn div_assign(&mut self, other: u32)
fn div_assign(&mut self, other: u32)
/=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> From<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> From<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> MulAssign<u32> for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> MulAssign<u32> for Duration<u32, NOM, DENOM>
source§fn mul_assign(&mut self, other: u32)
fn mul_assign(&mut self, other: u32)
*=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> MulAssign<u32> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> MulAssign<u32> for Duration<u64, NOM, DENOM>
source§fn mul_assign(&mut self, other: u32)
fn mul_assign(&mut self, other: u32)
*=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> Ord for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Ord for Duration<u32, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Ord for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Ord for Duration<u64, NOM, DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u32, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u32, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u64, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u64, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialEq<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u32, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u32, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u32, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u64, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u64, R_NOM, R_DENOM>> for Duration<u32, L_NOM, L_DENOM>
source§impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
impl<const L_NOM: u32, const L_DENOM: u32, const R_NOM: u32, const R_DENOM: u32> PartialOrd<Duration<u64, R_NOM, R_DENOM>> for Duration<u64, L_NOM, L_DENOM>
source§impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Sub<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> Sub<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Sub<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Duration<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Instant<u32, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u32, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign<Duration<u64, NOM, DENOM>> for Instant<u64, NOM, DENOM>
source§impl<const NOM: u32, const DENOM: u32> SubAssign for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign for Duration<u32, NOM, DENOM>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> SubAssign for Duration<u64, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> SubAssign for Duration<u64, NOM, DENOM>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read moresource§impl<const NOM: u32, const DENOM: u32> TryFrom<Duration<u64, NOM, DENOM>> for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> TryFrom<Duration<u64, NOM, DENOM>> for Duration<u32, NOM, DENOM>
impl<T: Copy, const NOM: u32, const DENOM: u32> Copy for Duration<T, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Eq for Duration<u32, NOM, DENOM>
impl<const NOM: u32, const DENOM: u32> Eq for Duration<u64, NOM, DENOM>
Auto Trait Implementations§
impl<T, const NOM: u32, const DENOM: u32> Freeze for Duration<T, NOM, DENOM>where
T: Freeze,
impl<T, const NOM: u32, const DENOM: u32> RefUnwindSafe for Duration<T, NOM, DENOM>where
T: RefUnwindSafe,
impl<T, const NOM: u32, const DENOM: u32> Send for Duration<T, NOM, DENOM>where
T: Send,
impl<T, const NOM: u32, const DENOM: u32> Sync for Duration<T, NOM, DENOM>where
T: Sync,
impl<T, const NOM: u32, const DENOM: u32> Unpin for Duration<T, NOM, DENOM>where
T: Unpin,
impl<T, const NOM: u32, const DENOM: u32> UnwindSafe for Duration<T, NOM, DENOM>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)