pub struct TimeDelta { /* private fields */ }Expand description
A difference between Timestamp values. Can be used to adjust timestamps.
Implementations§
Source§impl TimeDelta
impl TimeDelta
Sourcepub fn new(secs: i64, nanos: u32) -> Option<Self>
pub fn new(secs: i64, nanos: u32) -> Option<Self>
Construct a new time delta. Fails if nanoseconds is one billion or more.
Sourcepub fn from_secs(secs: i64) -> Self
pub fn from_secs(secs: i64) -> Self
Construct a TimeDelta from the specified number of seconds.
Sourcepub fn from_millis(millis: i64) -> Self
pub fn from_millis(millis: i64) -> Self
Construct a TimeDelta from the specified number of milliseconds.
Sourcepub fn from_micros(micros: i64) -> Self
pub fn from_micros(micros: i64) -> Self
Construct a TimeDelta from the specified number of microseconds.
Sourcepub fn from_nanos(nanos: i64) -> Self
pub fn from_nanos(nanos: i64) -> Self
Construct a TimeDelta from the specified number of nanoseconds.
Sourcepub fn subsec_nanos(&self) -> u32
pub fn subsec_nanos(&self) -> u32
Returns the fractional part of this TimeDelta, in nanoseconds.
Trait Implementations§
Source§impl AddAssign<TimeDelta> for Timestamp
impl AddAssign<TimeDelta> for Timestamp
Source§fn add_assign(&mut self, rhs: TimeDelta)
fn add_assign(&mut self, rhs: TimeDelta)
Performs the
+= operation. Read moreSource§impl AddAssign for TimeDelta
impl AddAssign for TimeDelta
Source§fn add_assign(&mut self, rhs: TimeDelta)
fn add_assign(&mut self, rhs: TimeDelta)
Performs the
+= operation. Read moreSource§impl<'de> Deserialize<'de> for TimeDelta
impl<'de> Deserialize<'de> for TimeDelta
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 SubAssign<TimeDelta> for Timestamp
impl SubAssign<TimeDelta> for Timestamp
Source§fn sub_assign(&mut self, rhs: TimeDelta)
fn sub_assign(&mut self, rhs: TimeDelta)
Performs the
-= operation. Read moreSource§impl SubAssign for TimeDelta
impl SubAssign for TimeDelta
Source§fn sub_assign(&mut self, rhs: TimeDelta)
fn sub_assign(&mut self, rhs: TimeDelta)
Performs the
-= operation. Read moreimpl Copy for TimeDelta
impl Eq for TimeDelta
impl StructuralPartialEq for TimeDelta
Auto Trait Implementations§
impl Freeze for TimeDelta
impl RefUnwindSafe for TimeDelta
impl Send for TimeDelta
impl Sync for TimeDelta
impl Unpin for TimeDelta
impl UnwindSafe for TimeDelta
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