Crate set_trie

Crate set_trie 

Source
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§

CreatedEntry
Indicates that the entry was created.
EntryBuilder
EntryBuilder for the entry method. Entries are lazily evaluated, thus the builder is used to provide the configuration, while the entry is already evaluated.
ExistingEntry
Indicates that the entry already exists.
SetTrie
SetTries allow for efficient subset and superset queries. Think of it as a HashMap, where you want the key to be within or containing a range.

Enums§

Entry
A view into a node of a SetTrie, either created or already existing.