pub struct Timestamp(/* private fields */);Expand description
Milliseconds since the Unix epoch, UTC, in 0..=MAX_TIMESTAMP_MS.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn from_ms(ms: i64) -> Result<Self, TimeRangeError>
pub fn from_ms(ms: i64) -> Result<Self, TimeRangeError>
A validated timestamp.
pub fn as_ms(self) -> i64
Sourcepub fn since(self, earlier: Timestamp) -> Result<DurationMs, TimeRangeError>
pub fn since(self, earlier: Timestamp) -> Result<DurationMs, TimeRangeError>
self - earlier, refused when negative.
pub fn checked_add(self, d: DurationMs) -> Result<Timestamp, TimeRangeError>
pub fn checked_sub(self, d: DurationMs) -> Result<Timestamp, TimeRangeError>
Trait Implementations§
impl Copy for Timestamp
Source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Timestamp
Source§impl JsonSchema for Timestamp
impl JsonSchema for Timestamp
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
The range the parser enforces.
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Timestamp
impl Ord for Timestamp
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 PartialOrd for Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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