{"id":18498327,"url":"https://github.com/softdevteam/vob","last_synced_at":"2025-04-09T00:31:12.629Z","repository":{"id":28651894,"uuid":"118976046","full_name":"softdevteam/vob","owner":"softdevteam","description":"Vector of Bits","archived":false,"fork":false,"pushed_at":"2025-03-17T09:45:12.000Z","size":178,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-17T10:29:43.625Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softdevteam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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}},"created_at":"2018-01-25T22:39:15.000Z","updated_at":"2025-03-17T09:45:15.000Z","dependencies_parsed_at":"2025-03-17T10:37:52.781Z","dependency_job_id":null,"html_url":"https://github.com/softdevteam/vob","commit_stats":{"total_commits":86,"total_committers":4,"mean_commits":21.5,"dds":"0.34883720930232553","last_synced_commit":"b7a492c1e126d23f33a8b678542693b7357010db"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Fvob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Fvob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Fvob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Fvob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softdevteam","download_url":"https://codeload.github.com/softdevteam/vob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949830,"owners_count":21023397,"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-11-06T13:38:42.615Z","updated_at":"2025-04-09T00:31:07.609Z","avatar_url":"https://github.com/softdevteam.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest version](https://img.shields.io/crates/v/vob.svg)](https://crates.io/crates/vob)\n[![Documentation](https://docs.rs/vob/badge.svg)](https://docs.rs/vob)\n\n# Vector of Bits (Vob)\n\nA Vob is a \"vector of bits\": a sequence of bits which exposes a `Vec`-like\ninterface. Whereas `Vec\u003cbool\u003e` requires 1 byte of storage per bit, `Vob`\nrequires only 1 bit of storage per bit. `Vob` is broadly\nsimilar to [BitVec](https://crates.io/crates/bit-vec), but has an API more\nclosely aligned to `Vec\u003cbool\u003e` and allows non-32-bit backing storage. On 64-bit\nsystems this can lead to a substantial performance increase, particularly\nwhen functions such as\n[`iter_set_bits`](https://docs.rs/vob/0.1.0/vob/struct.Vob.html#method.iter_set_bits)\nare used.\n\n## Usage\n\n```rust\nuse vob::vob;\n\nlet mut v = vob![false, true, false];\nassert_eq!(v[2], false);\nv.set(2, true);\nassert_eq!(v[2], true);\nassert_eq!(v.iter_set_bits(..).collect::\u003cVec\u003c_\u003e\u003e(), vec![1, 2]);\n```\n\n## Migrating from `Vec\u003cbool\u003e`\n\nAs far as possible, `Vob` is intended to have a superset of `Vec\u003cbool\u003e`'s interface, which\nshould make porting most code fairly simple. However, `Vec\u003cbool\u003e` contains several functions\nwhich are not yet implemented in `Vob`: these are missing simply due to a lack of a current\nuse-case rather than because of any fundamental incompatibilities.\n\nThere is one missing feature which, currently, is impossible to implement: assignment to an\nindex. In other words one cannot currently express `v[0] = true` for a `Vob` `v`. Until\n[`IndexGet` / `IndexMove` and equivalents](https://github.com/rust-lang/rfcs/issues/997) are\nimplemented in `rustc`, this restriction appears to be inevitable. Note that referencing by\nindex works (though via a hack identical to that used in `BitVec`): one can write\n`println!(\"{}\", v[0])` for a `Vob` `v`, for example.\n\n\n## Migrating from `BitVec`\n\n`Vob` is directly inspired by the [`BitVec`](https://crates.io/crates/bit-vec) crate, but\naims to provide an interface more closely aligned to `Vec\u003cbool\u003e`. Several functions in\n`BitVec` have different names in `Vob`, but porting is in general fairly simple. The main\nsemantic difference is that `Vob`s `clear()` function empties the `Vob` of contents\n(i.e. sets its length to 0), whereas `BitVec`'s function of the same name unsets all bits\n(keeping the length unchanged). The same effect as `BitVec`'s `clear` can be achieved by\nusing `Vob`'s `set_all(false)` function.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftdevteam%2Fvob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftdevteam%2Fvob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftdevteam%2Fvob/lists"}