{"id":17396351,"url":"https://github.com/ibraheemdev/boxcar","last_synced_at":"2025-05-15T14:05:07.646Z","repository":{"id":57524479,"uuid":"469481001","full_name":"ibraheemdev/boxcar","owner":"ibraheemdev","description":"A concurrent, append-only vector.","archived":false,"fork":false,"pushed_at":"2025-05-15T11:27:24.000Z","size":75,"stargazers_count":164,"open_issues_count":4,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-15T11:32:15.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibraheemdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-13T20:01:38.000Z","updated_at":"2025-05-14T08:44:01.000Z","dependencies_parsed_at":"2024-05-01T01:35:38.266Z","dependency_job_id":"67558f10-2714-4383-b278-9afb8606c2a9","html_url":"https://github.com/ibraheemdev/boxcar","commit_stats":{"total_commits":60,"total_committers":8,"mean_commits":7.5,"dds":0.1333333333333333,"last_synced_commit":"8726f43ee919abe4d49fba5738b67b87fd947ea5"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibraheemdev%2Fboxcar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibraheemdev%2Fboxcar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibraheemdev%2Fboxcar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibraheemdev%2Fboxcar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibraheemdev","download_url":"https://codeload.github.com/ibraheemdev/boxcar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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":[],"created_at":"2024-10-16T12:56:26.600Z","updated_at":"2025-05-15T14:05:07.484Z","avatar_url":"https://github.com/ibraheemdev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `boxcar`\n\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/boxcar?style=for-the-badge\" height=\"25\"\u003e](https://crates.io/crates/boxcar)\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-boxcar-blue?style=for-the-badge\" height=\"25\"\u003e](https://github.com/ibraheemdev/boxcar)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/docsrs/boxcar?style=for-the-badge\" height=\"25\"\u003e](https://docs.rs/boxcar)\n\nA concurrent, append-only vector.\n\nThe vector provided by this crate supports lock-free `get` and `push` operations.\nThe vector grows internally but never reallocates, so element addresses are stable\nfor the lifetime of the vector. Additionally, both `get` and `push` run in constant-time.\n\n## Examples\n\nAppending an element to a vector and retrieving it:\n\n```rust\nlet vec = boxcar::Vec::new();\nlet i = vec.push(42);\nassert_eq!(vec[i], 42);\n```\n\nThe vector can be modified by multiple threads concurrently:\n\n```rust\nlet vec = boxcar::Vec::new();\n\n// Spawn a few threads that append to the vector.\nstd::thread::scope(|s| for i in 0..6 {\n    let vec = \u0026vec;\n\n    s.spawn(move || {\n        // Push through the shared reference.\n        vec.push(i);\n    });\n});\n\nfor i in 0..6 {\n    assert!(vec.iter().any(|(_, \u0026x)| x == i));\n}\n```\n\nElements can be mutated through fine-grained locking:\n\n```rust\nlet vec = boxcar::Vec::new();\n\nstd::thread::scope(|s| {\n    // Insert an element.\n    vec.push(std::sync::Mutex::new(0));\n\n    s.spawn(|| {\n        // Mutate through the lock.\n        *vec[0].lock().unwrap() += 1;\n    });\n});\n\nlet x = vec[0].lock().unwrap();\nassert_eq!(*x, 1);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibraheemdev%2Fboxcar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibraheemdev%2Fboxcar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibraheemdev%2Fboxcar/lists"}