negatable-set

Crates.ionegatable-set
lib.rsnegatable-set
version0.1.0
sourcesrc
created_at2020-11-02 20:02:49.247441
updated_at2020-11-02 20:02:49.247441
descriptionWrapper for sets that allows full boolean operations including negation
homepagehttps://github.com/rklaehn
repositoryhttps://github.com/rklaehn/negatable-set
max_upload_size
id308036
size33,342
RĂ¼diger Klaehn (rklaehn)

documentation

README

Wrapper for sets like HashSet or BTreeSet that allows full boolean operations including negation

TLDR

use maplit::btreeset;
use negatable_set::NegatableSet;
use std::collections::BTreeSet;

type Test = NegatableSet<BTreeSet<u64>>;

fn main() {
    let a = Test::from(btreeset! { 3,4,5 });
    let b = Test::from(btreeset! { 1,2,3 });
    let c = !&b;
    let d = &a | &c;
    println!("{:?} {:?} {:?} {:?}", a, b, c, d);
}
Commit count: 6

cargo fmt