Struct network_time::MillisecondDuration [−][src]
pub struct MillisecondDuration(_);
Represents a duration in milliseconds.
Methods
impl MillisecondDuration
[src]
impl MillisecondDuration
pub const Zero: Self
Zero: Self = <Self>::from_milliseconds(0)
Zero.
pub const OneSecond: Self
OneSecond: Self = <Self>::from_seconds(1)
One second.
pub const ThreeSeconds: Self
ThreeSeconds: Self = <Self>::from_seconds(3)
3 seconds.
pub const FiveSeconds: Self
FiveSeconds: Self = <Self>::from_seconds(5)
5 seconds.
pub const TenSeconds: Self
TenSeconds: Self = <Self>::from_seconds(10)
Ten seconds.
pub const FifteenSeconds: Self
FifteenSeconds: Self = <Self>::from_seconds(15)
Fifteen seconds.
pub const ThirtySeconds: Self
ThirtySeconds: Self = <Self>::from_seconds(30)
Thirty seconds.
pub const OneMinute: Self
OneMinute: Self = <Self>::from_minutes(1)
One minute.
pub const TwoMinutes: Self
TwoMinutes: Self = <Self>::from_minutes(2)
Two minutes.
pub const FourMinutes: Self
FourMinutes: Self = <Self>::from_minutes(4)
Four minutes.
pub const FiveMinutes: Self
FiveMinutes: Self = <Self>::from_minutes(5)
Five minutes.
pub const TwoHours: Self
TwoHours: Self = <Self>::from_seconds(1)
Two hours
pub const fn from_tick_duration(tick_duration: TickDuration) -> Self
[src]
pub const fn from_tick_duration(tick_duration: TickDuration) -> Self
From tick duration.
pub const fn from_milliseconds(milliseconds: u64) -> Self
[src]
pub const fn from_milliseconds(milliseconds: u64) -> Self
From milliseconds.
pub const fn from_seconds(seconds: u64) -> Self
[src]
pub const fn from_seconds(seconds: u64) -> Self
From seconds.
pub const fn from_minutes(minutes: u64) -> Self
[src]
pub const fn from_minutes(minutes: u64) -> Self
From minutes.
pub const fn from_hours(hours: u64) -> Self
[src]
pub const fn from_hours(hours: u64) -> Self
From hours.
pub fn is_zero(self) -> bool
[src]
pub fn is_zero(self) -> bool
Is zero.
pub fn is_not_zero(self) -> bool
[src]
pub fn is_not_zero(self) -> bool
Is not zero.
pub fn seconds_rounded_down(self) -> u64
[src]
pub fn seconds_rounded_down(self) -> u64
As seconds, rounded down.
pub fn absolute_difference(self, right: Self) -> MillisecondDuration
[src]
pub fn absolute_difference(self, right: Self) -> MillisecondDuration
Absolute difference, |self - right|
.
Trait Implementations
impl Debug for MillisecondDuration
[src]
impl Debug for MillisecondDuration
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for MillisecondDuration
[src]
impl Copy for MillisecondDuration
impl Clone for MillisecondDuration
[src]
impl Clone for MillisecondDuration
fn clone(&self) -> MillisecondDuration
[src]
fn clone(&self) -> MillisecondDuration
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Ord for MillisecondDuration
[src]
impl Ord for MillisecondDuration
fn cmp(&self, other: &MillisecondDuration) -> Ordering
[src]
fn cmp(&self, other: &MillisecondDuration) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialOrd for MillisecondDuration
[src]
impl PartialOrd for MillisecondDuration
fn partial_cmp(&self, other: &MillisecondDuration) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &MillisecondDuration) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MillisecondDuration) -> bool
[src]
fn lt(&self, other: &MillisecondDuration) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MillisecondDuration) -> bool
[src]
fn le(&self, other: &MillisecondDuration) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &MillisecondDuration) -> bool
[src]
fn gt(&self, other: &MillisecondDuration) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MillisecondDuration) -> bool
[src]
fn ge(&self, other: &MillisecondDuration) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Eq for MillisecondDuration
[src]
impl Eq for MillisecondDuration
impl PartialEq for MillisecondDuration
[src]
impl PartialEq for MillisecondDuration
fn eq(&self, other: &MillisecondDuration) -> bool
[src]
fn eq(&self, other: &MillisecondDuration) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MillisecondDuration) -> bool
[src]
fn ne(&self, other: &MillisecondDuration) -> bool
This method tests for !=
.
impl Hash for MillisecondDuration
[src]
impl Hash for MillisecondDuration
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for MillisecondDuration
[src]
impl Display for MillisecondDuration
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<u8> for MillisecondDuration
[src]
impl From<u8> for MillisecondDuration
impl From<u16> for MillisecondDuration
[src]
impl From<u16> for MillisecondDuration
impl From<u32> for MillisecondDuration
[src]
impl From<u32> for MillisecondDuration
impl From<u64> for MillisecondDuration
[src]
impl From<u64> for MillisecondDuration
impl Into<u64> for MillisecondDuration
[src]
impl Into<u64> for MillisecondDuration
impl Into<TickDuration> for MillisecondDuration
[src]
impl Into<TickDuration> for MillisecondDuration
fn into(self) -> TickDuration
[src]
fn into(self) -> TickDuration
Performs the conversion.
impl Add for MillisecondDuration
[src]
impl Add for MillisecondDuration
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
fn add(self, rhs: Self) -> Self::Output
Performs the +
operation.
impl Sub for MillisecondDuration
[src]
impl Sub for MillisecondDuration
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
fn sub(self, rhs: Self) -> Self::Output
Performs the -
operation.
impl Mul<u64> for MillisecondDuration
[src]
impl Mul<u64> for MillisecondDuration
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: u64) -> Self::Output
[src]
fn mul(self, rhs: u64) -> Self::Output
Performs the *
operation.
impl Div for MillisecondDuration
[src]
impl Div for MillisecondDuration
type Output = u64
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
fn div(self, rhs: Self) -> Self::Output
Performs the /
operation.
impl Div<u64> for MillisecondDuration
[src]
impl Div<u64> for MillisecondDuration
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: u64) -> Self::Output
[src]
fn div(self, rhs: u64) -> Self::Output
Performs the /
operation.
impl Shl<u64> for MillisecondDuration
[src]
impl Shl<u64> for MillisecondDuration
type Output = Self
The resulting type after applying the <<
operator.
fn shl(self, rhs: u64) -> Self::Output
[src]
fn shl(self, rhs: u64) -> Self::Output
Performs the <<
operation.
impl Default for MillisecondDuration
[src]
impl Default for MillisecondDuration
impl Add<MillisecondDuration> for MonotonicMillisecondTimestamp
[src]
impl Add<MillisecondDuration> for MonotonicMillisecondTimestamp
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: MillisecondDuration) -> Self::Output
[src]
fn add(self, rhs: MillisecondDuration) -> Self::Output
Performs the +
operation.
Auto Trait Implementations
impl Send for MillisecondDuration
impl Send for MillisecondDuration
impl Sync for MillisecondDuration
impl Sync for MillisecondDuration