pub struct TimestampDelta(/* private fields */);
Expand description
A timestamp delta (duration) in nanoseconds.
Any time you subtract two timestamps, you get a TimestampDelta
.
Implementations§
Source§impl TimestampDelta
impl TimestampDelta
pub const fn zero() -> Self
pub const fn as_secs(&self) -> i64
pub const fn as_millis(&self) -> i64
pub const fn as_micros(&self) -> i64
pub const fn as_nanos(&self) -> i64
pub const fn from_hours(hours: i64) -> Self
pub const fn from_minutes(minutes: i64) -> Self
pub const fn from_secs(secs: i64) -> Self
pub const fn from_millis(millis: i64) -> Self
pub const fn from_micros(micros: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Trait Implementations§
Source§impl Add<TimeDelta> for TimestampDelta
impl Add<TimeDelta> for TimestampDelta
Source§impl Add<TimestampDelta> for Timestamp
impl Add<TimestampDelta> for Timestamp
Source§impl Add for TimestampDelta
impl Add for TimestampDelta
Source§type Output = TimestampDelta
type Output = TimestampDelta
The resulting type after applying the
+
operator.Source§impl Clone for TimestampDelta
impl Clone for TimestampDelta
Source§fn clone(&self) -> TimestampDelta
fn clone(&self) -> TimestampDelta
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TimestampDelta
impl Debug for TimestampDelta
Source§impl Default for TimestampDelta
impl Default for TimestampDelta
Source§fn default() -> TimestampDelta
fn default() -> TimestampDelta
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TimestampDelta
impl<'de> Deserialize<'de> for TimestampDelta
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 TimestampDelta
impl Display for TimestampDelta
Source§impl From<TimeDelta> for TimestampDelta
impl From<TimeDelta> for TimestampDelta
Source§impl From<TimestampDelta> for TimeDelta
impl From<TimestampDelta> for TimeDelta
Source§fn from(delta: TimestampDelta) -> Self
fn from(delta: TimestampDelta) -> Self
Converts to this type from the input type.
Source§impl From<i64> for TimestampDelta
impl From<i64> for TimestampDelta
Source§impl Ord for TimestampDelta
impl Ord for TimestampDelta
Source§fn cmp(&self, other: &TimestampDelta) -> Ordering
fn cmp(&self, other: &TimestampDelta) -> 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 TimestampDelta
impl PartialEq for TimestampDelta
Source§impl PartialOrd for TimestampDelta
impl PartialOrd for TimestampDelta
Source§impl Serialize for TimestampDelta
impl Serialize for TimestampDelta
Source§impl Sub<TimeDelta> for TimestampDelta
impl Sub<TimeDelta> for TimestampDelta
Source§impl Sub for TimestampDelta
impl Sub for TimestampDelta
Source§type Output = TimestampDelta
type Output = TimestampDelta
The resulting type after applying the
-
operator.impl Copy for TimestampDelta
impl Eq for TimestampDelta
impl StructuralPartialEq for TimestampDelta
Auto Trait Implementations§
impl Freeze for TimestampDelta
impl RefUnwindSafe for TimestampDelta
impl Send for TimestampDelta
impl Sync for TimestampDelta
impl Unpin for TimestampDelta
impl UnwindSafe for TimestampDelta
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