| Crates.io | atomic_struct_core |
| lib.rs | atomic_struct_core |
| version | 0.1.5 |
| created_at | 2025-08-30 13:27:39.633389+00 |
| updated_at | 2025-09-02 15:22:48.14662+00 |
| description | Core library for atomic_struct procedural macro |
| homepage | https://github.com/Pingoin/atomic_struct |
| repository | https://github.com/Pingoin/atomic_struct |
| max_upload_size | |
| id | 1817626 |
| size | 12,941 |
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.Add the crate to your Cargo.toml:
[dependencies]
atomic_struct_core = { version="0.1.5" } # or crates.io version when published
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);