pub struct UtcTimestamp { /* private fields */ }Expand description
A FIX UTCTimestamp as nanoseconds since the Unix epoch, keeping its precision.
Equality and ordering compare the instant and ignore the precision.
Implementations§
Source§impl UtcTimestamp
impl UtcTimestamp
Sourcepub const fn new(unix_nanos: i64, precision: TimePrecision) -> Self
pub const fn new(unix_nanos: i64, precision: TimePrecision) -> Self
The instant unix_nanos after the Unix epoch, written to precision.
Sourcepub const fn unix_nanos(&self) -> i64
pub const fn unix_nanos(&self) -> i64
Nanoseconds since 1970-01-01 00:00:00 UTC.
Sourcepub const fn precision(&self) -> TimePrecision
pub const fn precision(&self) -> TimePrecision
The precision the value was written to, such as MILLIS for .123.
Trait Implementations§
Source§impl Clone for UtcTimestamp
impl Clone for UtcTimestamp
impl Copy for UtcTimestamp
Source§impl Debug for UtcTimestamp
impl Debug for UtcTimestamp
impl Eq for UtcTimestamp
Source§impl From<UtcTimestamp> for DateTime<Utc>
impl From<UtcTimestamp> for DateTime<Utc>
Source§fn from(timestamp: UtcTimestamp) -> Self
fn from(timestamp: UtcTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<UtcTimestamp> for Timestamp
impl From<UtcTimestamp> for Timestamp
Source§fn from(timestamp: UtcTimestamp) -> Self
fn from(timestamp: UtcTimestamp) -> Self
Converts to this type from the input type.
Source§impl From<UtcTimestamp> for UtcDateTime
impl From<UtcTimestamp> for UtcDateTime
Source§fn from(timestamp: UtcTimestamp) -> Self
fn from(timestamp: UtcTimestamp) -> Self
Converts to this type from the input type.
Source§impl Hash for UtcTimestamp
impl Hash for UtcTimestamp
Source§impl Ord for UtcTimestamp
impl Ord for UtcTimestamp
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 UtcTimestamp
impl PartialEq for UtcTimestamp
Source§impl PartialOrd for UtcTimestamp
impl PartialOrd for UtcTimestamp
Source§impl TryFrom<Timestamp> for UtcTimestamp
impl TryFrom<Timestamp> for UtcTimestamp
Source§impl TryFrom<UtcDateTime> for UtcTimestamp
impl TryFrom<UtcDateTime> for UtcTimestamp
Source§type Error = OutOfRange
type Error = OutOfRange
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for UtcTimestamp
impl Freeze for UtcTimestamp
impl Move for UtcTimestamp
impl RefUnwindSafe for UtcTimestamp
impl Send for UtcTimestamp
impl Sync for UtcTimestamp
impl Unpin for UtcTimestamp
impl UnsafeUnpin for UtcTimestamp
impl UnwindSafe for UtcTimestamp
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