pub struct DurationUs(/* private fields */);
Expand description
Non-negative duration with microsecond resolution.
Implementations§
Source§impl DurationUs
impl DurationUs
pub const ZERO: Self
pub const fn from_micros(micros: u64) -> Self
pub const fn as_micros(self) -> u64
pub fn as_nanos(self) -> u128
pub fn as_nanos_i128(self) -> i128
pub fn from_nanos(nanos: u128) -> Result<Self>
pub fn as_millis(self) -> u64
pub const fn from_millis_u32(millis: u32) -> Self
pub fn from_millis(millis: u64) -> Result<Self>
pub fn as_secs(self) -> u64
pub const fn from_secs_u32(secs: u32) -> Self
pub fn from_secs(secs: u64) -> Result<Self>
pub fn from_days_u16(days: u16) -> Self
pub fn is_multiple_of(self, other: DurationUs) -> bool
pub const fn is_zero(self) -> bool
pub const fn is_positive(self) -> bool
pub fn checked_add(self, other: DurationUs) -> Result<Self>
pub fn checked_sub(self, other: DurationUs) -> Result<Self>
pub fn checked_mul(self, n: u64) -> Result<DurationUs>
pub fn checked_div(self, n: u64) -> Result<DurationUs>
Trait Implementations§
Source§impl Clone for DurationUs
impl Clone for DurationUs
Source§fn clone(&self) -> DurationUs
fn clone(&self) -> DurationUs
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DurationUs
impl Debug for DurationUs
Source§impl<'de> Deserialize<'de> for DurationUs
impl<'de> Deserialize<'de> for DurationUs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DurationUs> for Duration
impl From<DurationUs> for Duration
Source§fn from(value: DurationUs) -> Self
fn from(value: DurationUs) -> Self
Converts to this type from the input type.
Source§impl From<DurationUs> for Duration
impl From<DurationUs> for Duration
Source§fn from(duration: DurationUs) -> Self
fn from(duration: DurationUs) -> Self
Converts to this type from the input type.
Source§impl From<DurationUs> for DynamicValue
impl From<DurationUs> for DynamicValue
Source§fn from(value: DurationUs) -> Self
fn from(value: DurationUs) -> Self
Converts to this type from the input type.
Source§impl From<FixedRate> for DurationUs
impl From<FixedRate> for DurationUs
Source§impl Hash for DurationUs
impl Hash for DurationUs
Source§impl Ord for DurationUs
impl Ord for DurationUs
Source§fn cmp(&self, other: &DurationUs) -> Ordering
fn cmp(&self, other: &DurationUs) -> Ordering
1.21.0 · 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
Source§impl PartialEq for DurationUs
impl PartialEq for DurationUs
Source§impl PartialOrd for DurationUs
impl PartialOrd for DurationUs
Source§impl Serialize for DurationUs
impl Serialize for DurationUs
Source§impl TryFrom<&Duration> for DurationUs
impl TryFrom<&Duration> for DurationUs
Source§impl TryFrom<Duration> for DurationUs
impl TryFrom<Duration> for DurationUs
Source§impl TryFrom<Duration> for DurationUs
impl TryFrom<Duration> for DurationUs
Source§impl TryFrom<DurationUs> for FixedRate
impl TryFrom<DurationUs> for FixedRate
impl Copy for DurationUs
impl Eq for DurationUs
impl StructuralPartialEq for DurationUs
Auto Trait Implementations§
impl Freeze for DurationUs
impl RefUnwindSafe for DurationUs
impl Send for DurationUs
impl Sync for DurationUs
impl Unpin for DurationUs
impl UnwindSafe for DurationUs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more