t2t-core
The values of t2t: points on the wall, monotonic, boot and atomic
timelines, a hardware counter's readings, the spans between them, the rate that
turns ticks into nanoseconds, a UTC calendar, and a value stamped with the time
it was captured. Each is one i64 or a few, no_std and allocating nothing,
and each has a spelling it writes and reads back. The clocks that read them are
in t2t-clock, and t2t holds both.
Install
t2t-core builds with Rust 1.98 or later, with or without std.
Quick Start
use ;
Features
| Feature | Adds |
|---|---|
std |
SystemTime conversions |
serde |
every value's spelling, and the serde modules for counts in a named unit |
schemars |
JsonSchema for every value with a spelling; turns serde on |
zerocopy |
the zerocopy traits each type can honour, native-endian |
chrono-04 |
conversions to and from chrono 0.4's DateTime and TimeDelta |
jiff-02 |
conversions to and from jiff 0.2's Timestamp and SignedDuration |
time-03 |
conversions to and from time 0.3's OffsetDateTime and Duration |
None is on by default: cargo add t2t-core --features serde.
Documentation
- The book: what t2t is, and how its pieces fit.
- The API on docs.rs, with an example for each type.
- CHANGELOG.md: what changed in each release.
License
Either the MIT License or the Apache License, Version 2.0, at your option.