{"id":25663770,"url":"https://github.com/maxxsoft/key-node-list","last_synced_at":"2025-04-22T11:35:56.617Z","repository":{"id":62441618,"uuid":"440772943","full_name":"MaxXSoft/key-node-list","owner":"MaxXSoft","description":"Doubly-linked list that stores key-node pairs.","archived":false,"fork":false,"pushed_at":"2023-01-12T04:35:53.000Z","size":154,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T10:47:43.980Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxXSoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-22T07:33:36.000Z","updated_at":"2024-10-09T15:37:08.000Z","dependencies_parsed_at":"2023-02-09T10:02:04.729Z","dependency_job_id":null,"html_url":"https://github.com/MaxXSoft/key-node-list","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2Fkey-node-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2Fkey-node-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2Fkey-node-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxXSoft%2Fkey-node-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxXSoft","download_url":"https://codeload.github.com/MaxXSoft/key-node-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240420985,"owners_count":19798505,"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":"2025-02-24T05:19:01.698Z","updated_at":"2025-02-24T05:19:02.712Z","avatar_url":"https://github.com/MaxXSoft.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# key-node-list\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-MaxXSoft/key--node--list-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/MaxXSoft/key-node-list)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/key-node-list.svg?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/key-node-list)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-key--node--list-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logoColor=white\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K\" height=\"20\"\u003e](https://docs.rs/key-node-list)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/actions/workflow/status/MaxXSoft/key-node-list/build-test.yml?branch=master\u0026style=for-the-badge\" height=\"20\"\u003e](https://github.com/MaxXSoft/key-node-list/actions?query=branch%3Amaster)\n\nDoubly-linked list that stores key-node pairs.\n\n`KeyNodeList` is a doubly-linked list, it uses a hash map to maintain correspondence between keys and nodes, and records the previous key and the next key of the current node in the node itself. There is no pointer operations during this process, so `key_node_list` is all implemented in safe Rust.\n\nYou can complete key lookups, key-node pair updates, key-node pair deletions and other operations of `KeyNodeList` in *O*(1)~ time. You can also use cursor-based interface to traverse or edit the linked list.\n\n## Usage\n\n[`key_node_list` is available on crates.io](https://crates.io/crates/key-node-list):\n\n```\ncargo add key-node-list\n```\n\n## Example\n\n```rust\nuse key_node_list::KeyValueList;\n\n// construct key-value list from tuple array\nlet mut list = KeyValueList::from([(1, \"Reimu\"), (2, \"Marisa\")]);\n\n// or pushing other key-value pairs to the front/back of list\nlist.push_front(0, \"Alice\").unwrap();\nlist.push_back(3, \"Patchouli\").unwrap();\n\n// query nodes by key\nassert_eq!(list[\u00261].value(), \u0026\"Reimu\");\nassert_eq!(list[\u00260].value(), \u0026\"Alice\");\n\n// also you can update nodes by key\n*list.node_mut(\u00263).unwrap().value_mut() = \"Youmu\";\n*list.front_node_mut().unwrap().value_mut() = \"Mokou\";\nassert_eq!(list[\u00263].value(), \u0026\"Youmu\");\nassert_eq!(list[\u00260].value(), \u0026\"Mokou\");\nassert_eq!(list.front_node().unwrap().value(), \u0026\"Mokou\");\n\n// remove some key-node pairs\nassert!(list.pop_front().is_some());\nassert!(list.remove(\u00262).is_some());\n\n// all key-node pairs are in order\nlist.push_back(5, \"Yuyuko\");\nlet vec: Vec\u003c_\u003e = list.into_iter().map(|(k, n)| (k, n.into_value())).collect();\nassert_eq!(vec, [(1, \"Reimu\"), (3, \"Youmu\"), (5, \"Yuyuko\")]);\n```\n\nFor more details, visit [`key_node_list` on docs.rs](https://docs.rs/key-node-list).\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md).\n\n## License\n\nCopyright (C) 2010-2023 MaxXing. License GPLv3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxsoft%2Fkey-node-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxxsoft%2Fkey-node-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxxsoft%2Fkey-node-list/lists"}