{"id":19439185,"url":"https://github.com/spacejam/acid-state","last_synced_at":"2025-04-24T22:32:26.640Z","repository":{"id":57478990,"uuid":"80580802","full_name":"spacejam/acid-state","owner":"spacejam","description":"rust transactional state library","archived":false,"fork":false,"pushed_at":"2018-12-05T08:31:03.000Z","size":7,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T06:17:07.851Z","etag":null,"topics":["high-performance","persistence","rust","transactional"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spacejam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-01T01:47:48.000Z","updated_at":"2024-04-02T17:43:02.000Z","dependencies_parsed_at":"2022-09-18T05:45:01.835Z","dependency_job_id":null,"html_url":"https://github.com/spacejam/acid-state","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacejam%2Facid-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacejam%2Facid-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacejam%2Facid-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacejam%2Facid-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacejam","download_url":"https://codeload.github.com/spacejam/acid-state/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250719793,"owners_count":21476136,"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":["high-performance","persistence","rust","transactional"],"created_at":"2024-11-10T15:21:47.338Z","updated_at":"2025-04-24T22:32:26.580Z","avatar_url":"https://github.com/spacejam.png","language":"Rust","readme":"# acid-state\nrust transactional state library\n\nnote: not atomic yet, coming soon\n\ncurrently suitable for rapid prototyping of simple stateful systems\n\nnote: every op is O(n), so treat this as a poor man's DB for prototyping\n\n```rust\n#[macro_use]\nextern crate acid_state;\n#[macro_use]\nextern crate lazy_static;\nextern crate rustc_serialize;\n\nuse std::collections::HashMap;\n\n#[derive(Debug, RustcDecodable, RustcEncodable)]\nstruct Cs {\n    v: u64,\n}\n\nacid_state! {\n    A: HashMap\u003cString, u64\u003e = HashMap::new();\n    B: u64 = 0;\n    C: Cs = Cs {\n        v: 0\n    };\n}\n\nfn main() {\n    let key = \"yo\".to_owned();\n    acid! {\n        (A =\u003e a, B =\u003e b, C =\u003e c) =\u003e {\n            // A, B, C have been pulled off disk\n            let mut current = a.entry(key).or_insert(0);\n            **b += 1;\n            *current += 1;\n            c.v += 1;\n            println!(\"a is now {:?}\", current);\n            println!(\"b is now {:?}\", **b);\n            println!(\"c is now {:?}\", c.v);\n            // new values of A, B, C are now synced on disk\n        }\n    };\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacejam%2Facid-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacejam%2Facid-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacejam%2Facid-state/lists"}