{"id":13503034,"url":"https://github.com/tafia/nested","last_synced_at":"2025-08-19T10:05:00.883Z","repository":{"id":57644304,"uuid":"115683373","full_name":"tafia/nested","owner":"tafia","description":"A memory efficient container for rust nested collections","archived":false,"fork":false,"pushed_at":"2022-09-04T13:23:16.000Z","size":9,"stargazers_count":40,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T04:51:51.562Z","etag":null,"topics":["containers","heap","memory","rust"],"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/tafia.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE-MIT.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-29T03:39:53.000Z","updated_at":"2025-06-12T15:12:00.000Z","dependencies_parsed_at":"2022-08-30T08:20:41.644Z","dependency_job_id":null,"html_url":"https://github.com/tafia/nested","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tafia/nested","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tafia%2Fnested","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tafia%2Fnested/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tafia%2Fnested/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tafia%2Fnested/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tafia","download_url":"https://codeload.github.com/tafia/nested/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tafia%2Fnested/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271134681,"owners_count":24705098,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["containers","heap","memory","rust"],"created_at":"2024-07-31T22:02:34.274Z","updated_at":"2025-08-19T10:05:00.859Z","avatar_url":"https://github.com/tafia.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# nested\n\n[![Build Status](https://travis-ci.org/tafia/nested.svg?branch=master)](https://travis-ci.org/tafia/nested)\n[![Crate](http://meritbadge.herokuapp.com/nested)](https://crates.io/crates/nested)\n\nA memory efficient container for nested collections.\n\nThis crate is intended to be used when:\n- you want a potentially large:\n  - `Vec\u003cString\u003e`\n  - `Vec\u003cVec\u003cT\u003e\u003e`\n  - `Vec\u003cC\u003e` where `C` is heap allocated, dynamically sized and can implement `Collection` trait\n- you actually only need to use borrowed items (`\u0026[T]` or `\u0026str`)\n\nInstead of having n + 1 allocations, you'll only have 2.\n\n## Example\n\n```rust\nuse nested::Nested;\n\nlet mut v = Nested::\u003cString\u003e::new();\n\n// you can either populate it one by one\nv.push(\"a\");\nv.push(\"bb\".to_string());\nv.push(\"hhh\");\nv.extend(vec![\"iiiiii\".to_string(), \"jjjj\".to_string()]);\nassert_eq!(v.len(), 5);\nassert_eq!(\u0026v[0], \"a\");\nassert_eq!(\u0026v[1], \"bb\");\n\n// or you can directly collect it\nlet mut v = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\"].iter().collect::\u003cNested\u003cString\u003e\u003e();\nassert_eq!(v.len(), 7);\n\n// it also provides basic operations\nlet u = v.split_off(2);\nassert_eq!(u.get(0), Some(\"c\"));\n\nv.truncate(1);\nassert_eq!(v.pop(), Some(\"a\".to_string()));\nassert_eq!(v.pop(), None);\n```\n\n## Benches\n\nSee benches directory.\n\nHere are the benches for collecting all words in src/lib.rs file:\n\n```\ntest bench_nested_string      ... bench:      55,381 ns/iter (+/- 7,852)\ntest bench_nested_string_iter ... bench:      95,127 ns/iter (+/- 8,253)\ntest bench_vec_string         ... bench:     117,203 ns/iter (+/- 13,089)\ntest bench_vec_string_iter    ... bench:     142,245 ns/iter (+/- 24,701)\n```\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftafia%2Fnested","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftafia%2Fnested","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftafia%2Fnested/lists"}