{"id":18044600,"url":"https://github.com/lucidfrontier45/indexed-vector","last_synced_at":"2025-04-05T03:26:39.472Z","repository":{"id":117932671,"uuid":"610247776","full_name":"lucidfrontier45/indexed-vector","owner":"lucidfrontier45","description":"A Rust library that implements vector container that can be indexed with specified function.","archived":false,"fork":false,"pushed_at":"2023-03-06T13:39:28.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T14:52:59.321Z","etag":null,"topics":["data-structures","rust"],"latest_commit_sha":null,"homepage":"","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/lucidfrontier45.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":"2023-03-06T11:50:45.000Z","updated_at":"2023-03-06T16:34:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff36d45b-a223-4533-8fe4-4b691e865b68","html_url":"https://github.com/lucidfrontier45/indexed-vector","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"218eec4f7d9363153dee1e8927cf636596dff027"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidfrontier45%2Findexed-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidfrontier45%2Findexed-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidfrontier45%2Findexed-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidfrontier45%2Findexed-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidfrontier45","download_url":"https://codeload.github.com/lucidfrontier45/indexed-vector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284473,"owners_count":20913686,"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":["data-structures","rust"],"created_at":"2024-10-30T18:09:33.206Z","updated_at":"2025-04-05T03:26:39.449Z","avatar_url":"https://github.com/lucidfrontier45.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# indexed-vector\nA Rust library that implements vector container that can be indexed with specified function.\n\n## Implemented Structs\n\n- `HashIndexedVector` implements a simple indexed vector with `HashMap`\n- `BTreeIndexedVector` implements an indexed vector with `BTreeMap`. It also supports range query.\n\n## Example\n\n```rust\nuse indexed_vector::{BTreeIndexedVector, HashIndexedVector, IndexedVector};\n\n#[derive(Clone, Debug)]\nstruct User {\n    name: String,\n    age: u16,\n}\n\n\nfn main() {\n    let users = vec![\n        User {\n            name: \"Tom\".to_owned(),\n            age: 20,\n        },\n        User {\n            name: \"Jane\".to_owned(),\n            age: 20,\n        },\n        User {\n            name: \"Ivan\".to_owned(),\n            age: 30,\n        },\n    ];\n\n    let hash_vec = HashIndexedVector::new(users.clone(), |user: \u0026User| user.age);\n    // Tom and Jane\n    dbg!(hash_vec.search(\u002620).collect::\u003cVec\u003c_\u003e\u003e());\n    // Ivan\n    dbg!(hash_vec.search(\u002630).collect::\u003cVec\u003c_\u003e\u003e());\n\n    let btree_vec = BTreeIndexedVector::new(users, |user: \u0026User| user.age);\n    // Tom, Jane and Ivan\n    dbg!(btree_vec.search_range(10..40).collect::\u003cVec\u003c_\u003e\u003e());\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidfrontier45%2Findexed-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidfrontier45%2Findexed-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidfrontier45%2Findexed-vector/lists"}