Expand description
Fast subset and superset queries based on tries.
use set_trie::SetTrie;
let mut employees = SetTrie::new();
employees.insert(&["accounting", "banking"], "Daniels");
employees.insert(&["accounting", "banking", "crime"], "Stevens");
assert_eq!(employees.subsets(&[&"accounting", &"banking", &"crime"]).collect::<Vec<_>>(), vec![&"Daniels", &"Stevens"]);
assert_eq!(employees.subsets(&[&"accounting", &"banking"]).collect::<Vec<_>>(), vec![&"Daniels"]);
assert_eq!(employees.supersets(&[&"accounting"]).collect::<Vec<_>>(), vec![&"Daniels", &"Stevens"]);
Structs§
- Created
Entry - Indicates that the entry was created.
- Entry
Builder EntryBuilder
for the entry method. Entries are lazily evaluated, thus the builder is used to provide the configuration, while the entry is already evaluated.- Existing
Entry - Indicates that the entry already exists.
- SetTrie
SetTries
allow for efficient subset and superset queries. Think of it as aHashMap
, where you want the key to be within or containing a range.