{"id":19381398,"url":"https://github.com/lukaskalbertodt/stable-vec","last_synced_at":"2026-03-07T13:01:05.961Z","repository":{"id":57668516,"uuid":"94909341","full_name":"LukasKalbertodt/stable-vec","owner":"LukasKalbertodt","description":"A Vec-like collection which guarantees stable indices and features O(1) deletion of elements","archived":false,"fork":false,"pushed_at":"2024-03-17T13:33:32.000Z","size":377,"stargazers_count":21,"open_issues_count":8,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-04T08:25:59.446Z","etag":null,"topics":["data-structures","indices","rust","rust-library","stable","vec"],"latest_commit_sha":null,"homepage":"https://docs.rs/stable-vec","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-06-20T15:54:05.000Z","updated_at":"2025-05-20T20:18:33.000Z","dependencies_parsed_at":"2022-08-27T03:24:50.670Z","dependency_job_id":null,"html_url":"https://github.com/LukasKalbertodt/stable-vec","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/LukasKalbertodt/stable-vec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fstable-vec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fstable-vec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fstable-vec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fstable-vec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukasKalbertodt","download_url":"https://codeload.github.com/LukasKalbertodt/stable-vec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasKalbertodt%2Fstable-vec/sbom","scorecard":{"id":86597,"data":{"date":"2025-08-11","repo":{"name":"github.com/LukasKalbertodt/stable-vec","commit":"e82a7d2b46357590855355ef3495537e11dae4f5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 2/9 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/LukasKalbertodt/stable-vec/ci.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T07:03:51.820Z","repository_id":57668516,"created_at":"2025-08-15T07:03:51.820Z","updated_at":"2025-08-15T07:03:51.820Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30214591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T12:15:00.571Z","status":"ssl_error","status_checked_at":"2026-03-07T12:15:00.217Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-structures","indices","rust","rust-library","stable","vec"],"created_at":"2024-11-10T09:16:56.781Z","updated_at":"2026-03-07T13:01:05.926Z","avatar_url":"https://github.com/LukasKalbertodt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stable-vec\n[\u003cimg alt=\"CI status of master\" src=\"https://img.shields.io/github/actions/workflow/status/LukasKalbertodt/stable-vec/ci.yml?branch=master\u0026label=CI\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge\" height=\"23\"\u003e](https://github.com/LukasKalbertodt/stable-vec/actions/workflows/ci.yml)\n[\u003cimg alt=\"Crates.io Version\" src=\"https://img.shields.io/crates/v/stable-vec?logo=rust\u0026style=for-the-badge\" height=\"23\"\u003e](https://crates.io/crates/stable-vec)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/crates/v/stable-vec?color=blue\u0026label=docs\u0026style=for-the-badge\" height=\"23\"\u003e](https://docs.rs/stable-vec)\n\nA `Vec\u003cT\u003e`-like collection which guarantees stable indices and features O(1) element removal at the cost of wasting some memory.\nIt is semantically very similar to `Vec\u003cOption\u003cT\u003e\u003e`, but with a more optimized memory layout and a more convenient API.\nThis data structure is very useful as a foundation to implement other data structures like graphs and polygon meshes.\nIn those situations, `stable-vec` functions a bit like an arena memory allocator.\nThis crate works in `#![no_std]` context (it needs the `alloc` crate, though).\n\nThis crate implements different strategies to store the information.\nAs these strategies have slightly different performance characteristics, the user can choose which to use.\nThe two main strategies are:\n- something similar to `Vec\u003cT\u003e` with a `BitVec` (used by default), and\n- something similar to `Vec\u003cOption\u003cT\u003e\u003e`.\n\nPlease refer to [**the documentation**](https://docs.rs/stable-vec) for more information. Example:\n\n```rust\nlet mut sv = StableVec::new();\nlet star_idx = sv.push('★');\nlet heart_idx = sv.push('♥');\nlet lamda_idx = sv.push('λ');\n\n// Deleting an element does not invalidate any other indices.\nsv.remove(star_idx);\nassert_eq!(sv[heart_idx], '♥');\nassert_eq!(sv[lamda_idx], 'λ');\n\n// You can insert into empty slots (again, without invalidating any indices)\nsv.insert(star_idx, '☺');\n\n// We can also reserve memory (create new empty slots) and insert into\n// these new slots. All slots up to `sv.capacity()` can be accessed.\nsv.reserve_for(15);\nassert_eq!(sv.get(15), None);\nsv.insert(15, '☮');\n\n// The final state of the stable vec\nassert_eq!(sv.get(0), Some(\u0026'☺'));\nassert_eq!(sv.get(1), Some(\u0026'♥'));\nassert_eq!(sv.get(2), Some(\u0026'λ'));\nassert_eq!(sv.get(3), None);\nassert_eq!(sv.get(14), None);\nassert_eq!(sv.get(15), Some(\u0026'☮'));\n```\n\n\n### Alternatives? What about `slab`?\n\nThe crate [`slab`](https://crates.io/crates/slab) works very similar to `stable-vec`, but has way more downloads.\nDespite being very similar, there are a few differences which might be important for you:\n\n- `slab` reuses keys of deleted entries, while `stable-vec` does not automatically.\n- `slab` does a bit more management internally to quickly know which keys to reuse and where to insert.\n  This might incur a tiny bit of overhead.\n  Most notably: each entry in the underlying `Vec` in `slab` is at least `size_of::\u003cusize\u003e() + 1` bytes large.\n  If you're storing small elements, this might be a significant memory usage overhead.\n- `slab` has a fixed memory layout while `stable-vec` lets you choose between different layouts.\n  These have different performance characteristics and you might want to choose the right one for your situation.\n- The API of `stable-vec` is a bit more low level.\n\n---\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskalbertodt%2Fstable-vec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukaskalbertodt%2Fstable-vec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskalbertodt%2Fstable-vec/lists"}