pulz-bitset 0.1.0-alpha2

A simple bitset implementation
Documentation
  • Coverage
  • 25%
    6 out of 24 items documented1 out of 24 items with examples
  • Size
  • Source code size: 20.96 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.46 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • HellButcher/pulz
    4 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • HellButcher

pulz-bitset

Crates.io docs.rs license: MIT/Apache-2.0 Rust CI

A simple bitset implementation.

Example

use pulz_bitset::BitSet;

let mut bitset = BitSet::new();

assert!(!bitset.contains(1));
assert!(!bitset.contains(1337));

// insert new value
assert!(bitset.insert(1337));
assert!(!bitset.contains(1));
assert!(bitset.contains(1337));

// insert an other value
assert!(bitset.insert(1));
assert!(bitset.contains(1));

// inserting an already existing value returns false
assert!(!bitset.insert(1));
// removing a value, that was not inserted
assert!(!bitset.remove(333));
// removing an inserted value
assert!(bitset.remove(1337));
// removing a value, that was already removed
assert!(!bitset.remove(1337));

assert!(bitset.contains(1));
assert!(!bitset.contains(333));
assert!(!bitset.contains(1337));

License

This project is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.