[−][src]Struct utctimestamp::UtcTimeStamp
Represents a dumb but fast UTC timestamp.
Implementations
impl UtcTimeStamp
[src]
pub const fn zero() -> Self
[src]
Initialize a timestamp with 0, 1970-01-01 00:00:00 UTC
.
pub fn now() -> Self
[src]
Initialize a timestamp using the current local time converted to UTC.
pub const fn from_milliseconds(int: i64) -> Self
[src]
Explicit conversion from i64
.
pub const fn from_seconds(int: i64) -> Self
[src]
Explicit conversion from i64
seconds.
pub const fn as_milliseconds(self) -> i64
[src]
Explicit conversion to i64
.
pub const fn align_to(self, freq: TimeDelta) -> UtcTimeStamp
[src]
Align a timestamp to a given frequency.
pub const fn align_to_anchored(
self,
anchor: UtcTimeStamp,
freq: TimeDelta
) -> UtcTimeStamp
[src]
self,
anchor: UtcTimeStamp,
freq: TimeDelta
) -> UtcTimeStamp
Align a timestamp to a given frequency, with a time anchor.
pub const fn is_zero(self) -> bool
[src]
Check whether the timestamp is 0 (1970-01-01 00:00:00 UTC
).
Trait Implementations
impl Add<TimeDelta> for UtcTimeStamp
[src]
Calculate the timestamp advanced by a timedelta.
type Output = UtcTimeStamp
The resulting type after applying the +
operator.
fn add(self, rhs: TimeDelta) -> Self::Output
[src]
impl AddAssign<TimeDelta> for UtcTimeStamp
[src]
fn add_assign(&mut self, rhs: TimeDelta)
[src]
impl Clone for UtcTimeStamp
[src]
fn clone(&self) -> UtcTimeStamp
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for UtcTimeStamp
[src]
impl Debug for UtcTimeStamp
[src]
impl Display for UtcTimeStamp
[src]
Display timestamp using chrono.
impl Eq for UtcTimeStamp
[src]
impl From<DateTime<Utc>> for UtcTimeStamp
[src]
Create a dumb timestamp from a chrono date time object.
impl From<UtcTimeStamp> for DateTime<Utc>
[src]
Create a chrono date time object from a dumb timestamp.
fn from(other: UtcTimeStamp) -> Self
[src]
impl Hash for UtcTimeStamp
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for UtcTimeStamp
[src]
fn cmp(&self, other: &UtcTimeStamp) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<UtcTimeStamp> for UtcTimeStamp
[src]
fn eq(&self, other: &UtcTimeStamp) -> bool
[src]
fn ne(&self, other: &UtcTimeStamp) -> bool
[src]
impl PartialOrd<UtcTimeStamp> for UtcTimeStamp
[src]
fn partial_cmp(&self, other: &UtcTimeStamp) -> Option<Ordering>
[src]
fn lt(&self, other: &UtcTimeStamp) -> bool
[src]
fn le(&self, other: &UtcTimeStamp) -> bool
[src]
fn gt(&self, other: &UtcTimeStamp) -> bool
[src]
fn ge(&self, other: &UtcTimeStamp) -> bool
[src]
impl StructuralEq for UtcTimeStamp
[src]
impl StructuralPartialEq for UtcTimeStamp
[src]
impl Sub<TimeDelta> for UtcTimeStamp
[src]
Calculate the timestamp lessened by a timedelta.
type Output = UtcTimeStamp
The resulting type after applying the -
operator.
fn sub(self, rhs: TimeDelta) -> Self::Output
[src]
impl Sub<UtcTimeStamp> for UtcTimeStamp
[src]
Calculate signed timedelta between two timestamps.
type Output = TimeDelta
The resulting type after applying the -
operator.
fn sub(self, rhs: UtcTimeStamp) -> Self::Output
[src]
impl SubAssign<TimeDelta> for UtcTimeStamp
[src]
fn sub_assign(&mut self, rhs: TimeDelta)
[src]
Auto Trait Implementations
impl RefUnwindSafe for UtcTimeStamp
impl Send for UtcTimeStamp
impl Sync for UtcTimeStamp
impl Unpin for UtcTimeStamp
impl UnwindSafe for UtcTimeStamp
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,