pub struct WrappingU64Duration<const BITS: u32 = 64>(/* private fields */);Expand description
A non-negative duration in a WrappingU64Time domain.
Implementations§
Source§impl<const BITS: u32> WrappingU64Duration<BITS>
impl<const BITS: u32> WrappingU64Duration<BITS>
Sourcepub fn wrapping_new(x: u64) -> Self
pub fn wrapping_new(x: u64) -> Self
Construct a duration from an arbitrary u64 value.
The provided value may be greater than 2^BITS.
The duration will behave as if the top bits had been masked off.
When and how this masking is performed is unspecified.
Sourcepub fn to_ticks(self) -> u64
pub fn to_ticks(self) -> u64
Convert to a tick count in the range 0..2^BITS.
If BITS<64, this type may use additional bits for extra precision.
The rounding behaviour of to_ticks is unspecified.
Trait Implementations§
Source§impl<const BITS: u32> Clone for WrappingU64Duration<BITS>
impl<const BITS: u32> Clone for WrappingU64Duration<BITS>
impl<const BITS: u32> Copy for WrappingU64Duration<BITS>
Source§impl<const BITS: u32> Debug for WrappingU64Duration<BITS>
impl<const BITS: u32> Debug for WrappingU64Duration<BITS>
Source§impl<const BITS: u32> DurationCalibration<WrappingU64Duration<BITS>> for U64Calibration<BITS>
impl<const BITS: u32> DurationCalibration<WrappingU64Duration<BITS>> for U64Calibration<BITS>
Source§fn convert_to_ns(&self, d: WrappingU64Duration<BITS>) -> u64
fn convert_to_ns(&self, d: WrappingU64Duration<BITS>) -> u64
Converts a duration to nanoseconds, rounding to the nearest nanosecond.
Source§fn convert_from_ns(&self, ns: u64) -> WrappingU64Duration<BITS>
fn convert_from_ns(&self, ns: u64) -> WrappingU64Duration<BITS>
Converts a nanosecond value to this clock’s native duration type.
fn to_std(&self, d: D) -> Durationwhere
Self: Sized,
fn convert_from_std(&self, d: Duration) -> Dwhere
Self: Sized,
impl<const BITS: u32> Eq for WrappingU64Duration<BITS>
Source§impl<const BITS: u32> Hash for WrappingU64Duration<BITS>
impl<const BITS: u32> Hash for WrappingU64Duration<BITS>
Source§impl<const BITS: u32> Ord for WrappingU64Duration<BITS>
impl<const BITS: u32> Ord for WrappingU64Duration<BITS>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<const BITS: u32> PartialEq for WrappingU64Duration<BITS>
impl<const BITS: u32> PartialEq for WrappingU64Duration<BITS>
Source§impl<const BITS: u32> PartialOrd for WrappingU64Duration<BITS>
impl<const BITS: u32> PartialOrd for WrappingU64Duration<BITS>
impl<const BITS: u32> StructuralPartialEq for WrappingU64Duration<BITS>
Auto Trait Implementations§
impl<const BITS: u32> Freeze for WrappingU64Duration<BITS>
impl<const BITS: u32> RefUnwindSafe for WrappingU64Duration<BITS>
impl<const BITS: u32> Send for WrappingU64Duration<BITS>
impl<const BITS: u32> Sync for WrappingU64Duration<BITS>
impl<const BITS: u32> Unpin for WrappingU64Duration<BITS>
impl<const BITS: u32> UnsafeUnpin for WrappingU64Duration<BITS>
impl<const BITS: u32> UnwindSafe for WrappingU64Duration<BITS>
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
Mutably borrows from an owned value. Read more