Expand description

A UTC timestamp for use in Holochain’s headers.

Includes a struct that gives a uniform well-ordered byte representation of a timestamp, used for chronologically ordered database keys

Structs

A UTC timestamp for use in Holochain’s headers. It is assumed to be untrustworthy: it may contain times offset from the UNIX epoch with the full +/- i64 range. Most of these times are not representable by a chrono::DateTime (which limits itself to a +/- i32 offset in days from Jan 1, 0AD and from 1970AD). Also, most differences between two Timestamps are not representable by either a chrono::Duration (which limits itself to +/- i64 milliseconds), nor by core::time::Duration (which limits itself to +’ve u64 seconds). Many constructions of these chrono and core::time types will panic!, so painful measures must be taken to avoid this outcome – it is not acceptable for our core Holochain algorithms to panic when accessing DHT Header information committed by other random Holochain nodes!

A representation of a Timestamp which can go into and out of a byte slice in-place without allocation. Useful for ordered database keys.

Enums

Constants

Total size in bytes of a TimestampKey

Functions

Returns the current system time as a Timestamp. We do not make this a holochain_zome_types timestamp::Timestamp impl now() method, because we need Timestamp to be WASM compatible, and chrono doesn’t have a now() implementation for WASM. So, use holochain_types timestamp::now() instead.

Type Definitions