atomic_struct_core

Crates.ioatomic_struct_core
lib.rsatomic_struct_core
version0.1.5
created_at2025-08-30 13:27:39.633389+00
updated_at2025-09-02 15:22:48.14662+00
descriptionCore library for atomic_struct procedural macro
homepagehttps://github.com/Pingoin/atomic_struct
repositoryhttps://github.com/Pingoin/atomic_struct
max_upload_size
id1817626
size12,941
(Pingoin)

documentation

https://docs.rs/atomic_struct_core

README

atomic_struct_core

atomic_struct_core provides the types used by the atomic_struct macros.

  • AtomicMember<T> wraps the type T in Arc<tokio::sync::Mutex<T>> and adds methods to change the inner Value.

Features

  • serde: activates serde compatibility fot the AtomicMember
    • fields are serilized without any mutex overhead

Installation

Add the crate to your Cargo.toml:

[dependencies]
atomic_struct_core = { version="0.1.5" }  # or crates.io version when published

Examples

let atomic_int = AtomicMember::new(5);
assert_eq!(atomic_int.get().await, 5);
atomic_int.set(10).await;
assert_eq!(atomic_int.get().await, 10);
Commit count: 19

cargo fmt