pub struct DurationMs(/* private fields */);Expand description
A relative span of time, measured in milliseconds (a period, timeout, or delay).
Implementations§
Source§impl DurationMs
impl DurationMs
Sourcepub const fn from_secs(secs: u64) -> Self
pub const fn from_secs(secs: u64) -> Self
Creates a span from whole seconds, saturating on overflow.
Sourcepub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_add(self, rhs: Self) -> Self
Adds two spans, saturating at DurationMs::MAX.
Sourcepub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
Subtracts two spans, saturating at DurationMs::ZERO.
Trait Implementations§
Source§impl Add for DurationMs
impl Add for DurationMs
Source§impl Add<DurationMs> for TimestampMs
impl Add<DurationMs> for TimestampMs
Source§type Output = TimestampMs
type Output = TimestampMs
The resulting type after applying the
+ operator.Source§impl BorshDeserialize for DurationMs
impl BorshDeserialize for DurationMs
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for DurationMs
impl BorshSerialize for DurationMs
Source§impl Clone for DurationMs
impl Clone for DurationMs
impl Copy for DurationMs
Source§impl Debug for DurationMs
impl Debug for DurationMs
Source§impl Default for DurationMs
impl Default for DurationMs
Source§impl<'de> Deserialize<'de> for DurationMs
impl<'de> Deserialize<'de> for DurationMs
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 Display for DurationMs
impl Display for DurationMs
impl Eq for DurationMs
Source§impl From<DurationMs> for u64
impl From<DurationMs> for u64
Source§fn from(span: DurationMs) -> Self
fn from(span: DurationMs) -> Self
Converts to this type from the input type.
Source§impl From<DurationMs> for Duration
impl From<DurationMs> for Duration
Source§fn from(span: DurationMs) -> Self
fn from(span: DurationMs) -> Self
Converts to this type from the input type.
Source§impl From<u64> for DurationMs
impl From<u64> for DurationMs
Source§impl FromStr for DurationMs
impl FromStr for DurationMs
Source§impl Hash for DurationMs
impl Hash for DurationMs
Source§impl Ord for DurationMs
impl Ord for DurationMs
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 PartialEq for DurationMs
impl PartialEq for DurationMs
Source§impl PartialOrd for DurationMs
impl PartialOrd for DurationMs
Source§impl Serialize for DurationMs
impl Serialize for DurationMs
impl StructuralPartialEq for DurationMs
Source§impl Sub for DurationMs
impl Sub for DurationMs
Source§impl Sub<DurationMs> for TimestampMs
impl Sub<DurationMs> for TimestampMs
Source§type Output = TimestampMs
type Output = TimestampMs
The resulting type after applying the
- operator.Auto Trait Implementations§
impl Freeze for DurationMs
impl RefUnwindSafe for DurationMs
impl Send for DurationMs
impl Sync for DurationMs
impl Unpin for DurationMs
impl UnsafeUnpin for DurationMs
impl UnwindSafe for DurationMs
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.