pub struct TimestampUs(/* private fields */);
Expand description
Unix timestamp with microsecond resolution.
Implementations§
Source§impl TimestampUs
impl TimestampUs
Source§impl TimestampUs
impl TimestampUs
pub const UNIX_EPOCH: Self
pub const MAX: 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 from_nanos_i128(nanos: i128) -> Result<Self>
pub fn as_millis(self) -> u64
pub fn from_millis(millis: u64) -> Result<Self>
pub fn as_secs(self) -> u64
pub fn from_secs(secs: u64) -> Result<Self>
pub fn duration_since(self, other: Self) -> Result<DurationUs>
pub fn saturating_duration_since(self, other: Self) -> DurationUs
pub fn elapsed(self) -> Result<DurationUs>
pub fn saturating_elapsed(self) -> DurationUs
pub fn saturating_add(self, duration: DurationUs) -> TimestampUs
pub fn saturating_sub(self, duration: DurationUs) -> TimestampUs
pub fn is_multiple_of(self, duration: DurationUs) -> bool
Sourcepub fn next_multiple_of(self, duration: DurationUs) -> Result<TimestampUs>
pub fn next_multiple_of(self, duration: DurationUs) -> Result<TimestampUs>
Calculates the smallest value greater than or equal to self that is a multiple of duration
.
Sourcepub fn previous_multiple_of(self, duration: DurationUs) -> Result<TimestampUs>
pub fn previous_multiple_of(self, duration: DurationUs) -> Result<TimestampUs>
Calculates the smallest value less than or equal to self that is a multiple of duration
.
pub fn checked_add(self, duration: DurationUs) -> Result<Self>
pub fn checked_sub(self, duration: DurationUs) -> Result<Self>
Trait Implementations§
Source§impl Clone for TimestampUs
impl Clone for TimestampUs
Source§fn clone(&self) -> TimestampUs
fn clone(&self) -> TimestampUs
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 TimestampUs
impl Debug for TimestampUs
Source§impl<'de> Deserialize<'de> for TimestampUs
impl<'de> Deserialize<'de> for TimestampUs
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<TimestampUs> for DynamicValue
impl From<TimestampUs> for DynamicValue
Source§fn from(value: TimestampUs) -> Self
fn from(value: TimestampUs) -> Self
Converts to this type from the input type.
Source§impl From<TimestampUs> for MessageField<Timestamp>
impl From<TimestampUs> for MessageField<Timestamp>
Source§fn from(value: TimestampUs) -> Self
fn from(value: TimestampUs) -> Self
Converts to this type from the input type.
Source§impl From<TimestampUs> for Timestamp
impl From<TimestampUs> for Timestamp
Source§fn from(timestamp: TimestampUs) -> Self
fn from(timestamp: TimestampUs) -> Self
Converts to this type from the input type.
Source§impl Hash for TimestampUs
impl Hash for TimestampUs
Source§impl Ord for TimestampUs
impl Ord for TimestampUs
Source§fn cmp(&self, other: &TimestampUs) -> Ordering
fn cmp(&self, other: &TimestampUs) -> 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 TimestampUs
impl PartialEq for TimestampUs
Source§impl PartialOrd for TimestampUs
impl PartialOrd for TimestampUs
Source§impl Serialize for TimestampUs
impl Serialize for TimestampUs
Source§impl TryFrom<&Timestamp> for TimestampUs
impl TryFrom<&Timestamp> for TimestampUs
Source§impl TryFrom<SystemTime> for TimestampUs
impl TryFrom<SystemTime> for TimestampUs
Source§impl TryFrom<Timestamp> for TimestampUs
impl TryFrom<Timestamp> for TimestampUs
Source§impl TryFrom<TimestampUs> for SystemTime
impl TryFrom<TimestampUs> for SystemTime
impl Copy for TimestampUs
impl Eq for TimestampUs
impl StructuralPartialEq for TimestampUs
Auto Trait Implementations§
impl Freeze for TimestampUs
impl RefUnwindSafe for TimestampUs
impl Send for TimestampUs
impl Sync for TimestampUs
impl Unpin for TimestampUs
impl UnwindSafe for TimestampUs
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