Crate atomiq

Source
Expand description

Convenient tool for atomics in Rust.

§Crate features

alloc — enables the Arc type. (default) derive — enables the derive macros. (default) loom — replaces the default implementation with the loom mock.

§Usage

use atomiq::prelude::*;

let atomic: Atomic<bool> = Atomic::from(false);
atomic.store(true, Ordering::Release);
assert_eq!(atomic.load(Ordering::Acquire), true);

Re-exports§

pub use atomiq_derive as derive;

Modules§

option
Simple atomic options.
prelude
The prelude module contains all the types and traits that are commonly used in the atomiq crate.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
Atomic
An atomic value.
CancellationToken
A token that can be used to cancel an async operation.

Enums§

Ordering
Atomic memory orderings

Traits§

Atom
A primitive atomizable value.
Atomizable
Trait for types that may be represented as atomic values.
Atomize
Extension trait for converting values into atomic.
BitAtom
A primitive atomizable bit value.
BitAtomizable
Trait for types that may be represented as atomic bit values.
IntAtom
A primitive atomizable integer value.
IntAtomizable
Trait for types that may be represented as atomic integer values.
OrderingExt
Extension trait for Ordering.

Functions§

try_init_model
Initializes the model for testing.