Module bonsaidb_core::key::time::limited
source · Expand description
Types for storing limited-precision Durations.
Structs
- A
TimeEpoch
implementation that allows storingLimitedResolutionTimestamp
relative to the 10-year anniversary of BonsaiDb: March 20, 2031 04:31:47 UTC. - A
Duration
of time stored with a limitedResolution
. This type may be preferred tostd::time::Duration
becauseDuration
takes a full 12 bytes to achieve its nanosecond resolution. - A timestamp (moment in time) stored with a limited
Resolution
. This type may be preferred tostd::time::SystemTime
becauseSystemTime
serializes with nanosecond resolution. Often this level of precision is not needed and less storage and memory can be used. - A
TimeEpoch
implementation that allows storingLimitedResolutionTimestamp
relative to the “unix epoch”: January 1, 1970 00:00:00 UTC.
Enums
- A
TimeResolution
implementation that truncates time measurements to days. Internally, the number of days is represented as ani32
, allowing a range of +/- ~5.88 million years. - A
TimeResolution
implementation that truncates time measurements to hours. Internally, the number of hours is represented as ani32
, allowing a range of +/- ~245,147 years. - A
TimeResolution
implementation that truncates time measurements to microseconds. Internally, the number of microseconds is represented as ani64
, allowing a range of +/- ~292,471 years. - A
TimeResolution
implementation that truncates time measurements to milliseconds. Internally, the number of milliseconds is represented as ani64
, allowing a range of +/- ~292.5 million years. - A
TimeResolution
implementation that truncates time measurements to minutes. Internally, the number of minutes is represented as ani32
, allowing a range of +/- ~4,086 years. - A
TimeResolution
implementation that preserves nanosecond resolution. Internally, the number of microseconds is represented as ani64
, allowing a range of +/- ~292.5 years. - A
TimeResolution
implementation that truncates time measurements to seconds. Internally, the number of seconds is represented as ani64
, allowing a range of +/- ~21 times the age of the universe. - A
Duration
that can be either negative or positive. - A
TimeResolution
implementation that truncates time measurements to weeks. Internally, the number of weeks is represented as ani32
, allowing a range of +/- ~41.18 million years.
Traits
- A timestamp that can report it sduration since the Unix Epoch.
- An epoch for
LimitedResolutionTimestamp
. - A resolution of a time measurement.