sans-io-time 0.1.0

Time structures for the sans-io pattern
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented7 out of 12 items with examples
  • Size
  • Source code size: 18.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.85 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ystreet/sans-io-time
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ystreet

sans-io-time

Represent time as an abstract absolute value based on an arbitrary start point in a (user-provided timeline.

Why?

  1. no_std environments may require an implementation of Instant.
  2. Network protocols may require that time continues during suspend of the OS which is not something that is guaranteed by std::time::Instant.
  3. Other uses of std::time::Instant should not count time during suspend e.g. CPU process time.

The Instant type provided by this crate satisfies all of these constraints by only specifying the carriage of data. It does not specify how the current time is acquired or whether time continues during suspend. Both of these questions are required to be answered (or left unspecified) by the caller by either using std::time::Instant or std::time::SystemTime (with the "std" feature that is enabled by default), or converting from another source of time like boot-time.