{"id":22901052,"url":"https://github.com/mpdn/scanmut","last_synced_at":"2025-05-08T01:44:33.405Z","repository":{"id":57666320,"uuid":"225160465","full_name":"mpdn/scanmut","owner":"mpdn","description":"O(n) multi-insert and -remove for Rust vectors","archived":false,"fork":false,"pushed_at":"2021-01-19T18:41:49.000Z","size":16,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-08T01:44:26.196Z","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/mpdn.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}},"created_at":"2019-12-01T12:49:11.000Z","updated_at":"2021-09-14T07:40:33.000Z","dependencies_parsed_at":"2022-09-26T20:31:40.721Z","dependency_job_id":null,"html_url":"https://github.com/mpdn/scanmut","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fscanmut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fscanmut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fscanmut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpdn%2Fscanmut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpdn","download_url":"https://codeload.github.com/mpdn/scanmut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252983757,"owners_count":21835758,"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-12-14T01:31:28.075Z","updated_at":"2025-05-08T01:44:33.052Z","avatar_url":"https://github.com/mpdn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scanmut\n\nInsert or remove multiple elements from a `Vec` in `O(n)` time.\n\nThis crate provides two types for versatile and efficient `Vec` mutation; `Inserter` and\n`Remover`. These two types can be seen as more generic implementations of `Vec::insert` and\n`Vec::drain`, allowing you to for example efficiently insert a slice, conditionally drain\nelements, or access elements of a `Vec` while draining from it.\n\n`Inserter` and `Remover` requires an ordering of the insert and removal indices; monotonically\nnon-increasing for `Inserter` and monotonically increasing for `Remover`.\n\nFor convenience, there are also extension traits adding common higher level operations using the\n`Inserter` and `Remover`. See `ScanMut`, `InsertSliceClone`, and `InsertSliceCopy`.\n\n## Examples\n\nInserting a slice into a vec using [ScanMut::insert_all]:\n\n```rust\nuse scanmut::prelude::*;\n\nlet mut v = vec!['a', 'b', 'c'];\nv.insert_all(1, ['d', 'e'].iter().cloned());\nassert_eq!(v, vec!['a', 'd', 'e', 'b', 'c']);\n```\n\nRemoving multiple elements in one scan using [ScanMut::multi_remove]:\n\n```rust\nuse scanmut::prelude::*;\n\nlet mut v = vec!['a', 'b', 'c'];\nv.multi_remove([0, 2].iter().cloned(), drop);\nassert_eq!(v, vec!['b']);\n```\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fscanmut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpdn%2Fscanmut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpdn%2Fscanmut/lists"}