pub struct TimestampMs(/* private fields */);Expand description
Domain value type representing a timestamp in milliseconds.
Implementations§
Source§impl TimestampMs
impl TimestampMs
Sourcepub const ZERO: TimestampMs
pub const ZERO: TimestampMs
Zero timestamp value.
Sourcepub const fn new(value: u64) -> TimestampMs
pub const fn new(value: u64) -> TimestampMs
Creates a new timestamp from milliseconds.
Sourcepub fn try_new(value: u64) -> Result<TimestampMs, PriceLevelError>
pub fn try_new(value: u64) -> Result<TimestampMs, PriceLevelError>
Creates a validated timestamp from milliseconds.
§Errors
Returns PriceLevelError::InvalidFieldValue if value ever fails the
timestamp invariant. Every u64 is currently a valid millisecond
timestamp, so this constructor is presently infallible; the Result is
part of its stable contract so validation can be tightened without a
breaking change.
Trait Implementations§
Source§impl Clone for TimestampMs
impl Clone for TimestampMs
Source§fn clone(&self) -> TimestampMs
fn clone(&self) -> TimestampMs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TimestampMs
Source§impl Debug for TimestampMs
impl Debug for TimestampMs
Source§impl Default for TimestampMs
impl Default for TimestampMs
Source§fn default() -> TimestampMs
fn default() -> TimestampMs
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TimestampMs
impl<'de> Deserialize<'de> for TimestampMs
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimestampMs, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimestampMs, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TimestampMs
impl Display for TimestampMs
impl Eq for TimestampMs
Source§impl FromStr for TimestampMs
impl FromStr for TimestampMs
Source§type Err = PriceLevelError
type Err = PriceLevelError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<TimestampMs, <TimestampMs as FromStr>::Err>
fn from_str(s: &str) -> Result<TimestampMs, <TimestampMs as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for TimestampMs
impl Hash for TimestampMs
Source§impl Ord for TimestampMs
impl Ord for TimestampMs
Source§fn cmp(&self, other: &TimestampMs) -> Ordering
fn cmp(&self, other: &TimestampMs) -> Ordering
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
Source§impl PartialEq for TimestampMs
impl PartialEq for TimestampMs
Source§impl PartialOrd for TimestampMs
impl PartialOrd for TimestampMs
Source§impl Serialize for TimestampMs
impl Serialize for TimestampMs
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TimestampMs
Auto Trait Implementations§
impl Freeze for TimestampMs
impl RefUnwindSafe for TimestampMs
impl Send for TimestampMs
impl Sync for TimestampMs
impl Unpin for TimestampMs
impl UnsafeUnpin for TimestampMs
impl UnwindSafe for TimestampMs
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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