{"id":19381394,"url":"https://github.com/lukaskalbertodt/atomig","last_synced_at":"2025-04-04T11:13:59.124Z","repository":{"id":35032115,"uuid":"197915350","full_name":"LukasKalbertodt/atomig","owner":"LukasKalbertodt","description":"Generic and convenient `std` atomics via `Atomic\u003cT\u003e`","archived":false,"fork":false,"pushed_at":"2024-10-18T15:33:28.000Z","size":165,"stargazers_count":46,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T10:09:40.896Z","etag":null,"topics":["atomics","cas","generic","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/atomig","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukasKalbertodt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-20T10:30:07.000Z","updated_at":"2025-01-31T01:43:38.000Z","dependencies_parsed_at":"2024-12-14T04:07:36.841Z","dependency_job_id":"67bb4507-4e1a-4659-8214-43c2ac87e193","html_url":"https://github.com/LukasKalbertodt/atomig","commit_stats":{"total_commits":83,"total_committers":6,"mean_commits":"13.833333333333334","dds":0.07228915662650603,"last_synced_commit":"b19a885f9fc24cb61bde3dc25deeb8de913c0e25"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fatomig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fatomig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fatomig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fatomig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukasKalbertodt","download_url":"https://codeload.github.com/LukasKalbertodt/atomig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atomics","cas","generic","rust"],"created_at":"2024-11-10T09:16:56.023Z","updated_at":"2025-04-04T11:13:59.093Z","avatar_url":"https://github.com/LukasKalbertodt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Atomig: generic and convenient `std` atomics\n============================================\n\n[\u003cimg alt=\"CI status of master\" src=\"https://img.shields.io/github/actions/workflow/status/LukasKalbertodt/atomig/ci.yml?branch=master\u0026label=CI\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge\" height=\"23\"\u003e](https://github.com/LukasKalbertodt/atomig/actions/workflows/ci.yml)\n[\u003cimg alt=\"Crates.io Version\" src=\"https://img.shields.io/crates/v/atomig?logo=rust\u0026style=for-the-badge\" height=\"23\"\u003e](https://crates.io/crates/atomig)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/crates/v/atomig?color=blue\u0026label=docs\u0026style=for-the-badge\" height=\"23\"\u003e](https://docs.rs/atomig)\n\nOffers `Atomic\u003cT\u003e` that can be used with primitive and custom types.\n*However*, it only works with types that can actually use atomic operations: a lock-based fallback for other types is not used!\nThis crate is based on `std`'s atomics and therefore does not contain any `unsafe` code!\nThis crate also does not have any dependencies by default.\nIf you enable the `serde` feature, then this crate will depend on `serde` and `Serialize` / `Deserialize` will be\nimplemented for `Atomic\u003cT\u003e` when appropriate, using sequentially-consistent ordering.\n\nSimple example with primitive types:\n\n```rust\nuse atomig::{Atomic, Ordering};\n\nlet x = Atomic::new(27); // `Atomic\u003ci32\u003e`\nx.store(39, Ordering::SeqCst);\n```\n\nThis works with almost all primitive types, including `f32`, `f64` and `char`,\nbut also with types like `std::ptr::NonNull` and `std::num::NonZero`.\n\nYou can automatically derive `Atom` for your own enum or struct types to use them in `Atomic\u003cT\u003e`.\nThere are some limitations, however.\n\n```rust\n// Requires the 'derive' feature:\n//     atomig = { version = \"_\", features = [\"derive\"] }\nuse atomig::{Atom, Atomic, Ordering};\n\n#[derive(Atom)]\n#[repr(u8)]\nenum Animal { Dog, Cat, Fox }\n\nlet animal = Atomic::new(Animal::Cat);\nanimal.store(Animal::Fox, Ordering::SeqCst);\n\n#[derive(Atom)]\nstruct Port(u16);\n\nlet port = Atomic::new(Port(80));\nport.store(Port(8080), Ordering::SeqCst);\n```\n\nFor more examples and information see **[the documentation](https://docs.rs/atomig)**.\n\n\u003cbr /\u003e\n\n---\n\n## License\n\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskalbertodt%2Fatomig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukaskalbertodt%2Fatomig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskalbertodt%2Fatomig/lists"}