Expand description
§atomic-primitive
Traits for primitive atomic types in Rust.
These traits provide a simple hierarchy for generic programming with Rust’s primitive atomic types:
PrimitiveAtomic:AtomicBooland all atomic integer types;PrimitiveAtomicInteger: all atomic integer types;
Additionally, AtomicPrimitive maps non-atomic primitive types to their
atomic counterparts, mirroring the unstable
core::sync::atomic::AtomicPrimitive trait.
It is not a goal of this crate to add any functionality to the atomic types,
only to expose what is already available in the standard library in a more
generic way, and make a few experimental traits and types available on stable.
The only addition is an AtomicPrimitive bound on PrimitiveAtomic::Value,
which enables bidirectional navigation between atomic and non-atomic types.
The traits are also sealed against downstream implementations to allow
expansion in a non-breaking way.
§Compatibility
This crate is currently tested for Rust 1.85 and greater.
Traits§
- Atomic
Primitive - Maps a non-atomic primitive type to its corresponding atomic type.
- Primitive
Atomic - Trait for all primitive atomic types, including
AtomicBooland all atomic integer types. - Primitive
Atomic Integer - Trait for all primitive atomic integer types, extending
PrimitiveAtomic. - Primitive
Atomic Signed - Marker trait for primitive atomic signed integer types.
- Primitive
Atomic Unsigned - Marker trait for primitive atomic unsigned integer types.
Type Aliases§
- Atomic
- Type alias for the atomic version of a primitive type.