Expand description
Atomic time types.
All types are thread-safe and use portable_atomic::AtomicU128 under the
hood. Operations are lock-free on platforms with native AtomicU128
support; otherwise, portable-atomic may fall back to a global lock. Each
type exposes an is_lock_free method to query the behavior of the current
target.
The std feature controls the SystemTime and Instant types. Disable it
for no_std builds to use the duration types without the standard library.
The optional arbitrary, quickcheck, and proptest features provide
fuzzing and property-testing support for the duration and system-time
atomic types. All three require std: the current upstream arbitrary v1
crate itself requires std. quickcheck additionally implements Clone
as a SeqCst snapshot: when another thread writes concurrently, the clone
is the value observed at its atomic linearization point.
AtomicInstant and AtomicOptionInstant intentionally do not implement
these generation traits. Their values use a process-local baseline and
cannot be generated from a deterministic, portable cross-run corpus.
Modules§
- utils
- Utility functions for encoding and decoding
core::time::Durationvalues.
Structs§
- Atomic
Duration - Atomic version of
Duration - Atomic
Instant std - Atomic version of
Instant. - Atomic
Option Duration - Atomic version of
Option<Duration>. - Atomic
Option Instant std - Atomic version of
Option<Instant>. - Atomic
Option System Time std - An atomic version of
Option<std::time::SystemTime>. - Atomic
System Time std - An atomic version of
std::time::SystemTime.
Enums§
- Ordering
- Atomic memory orderings