Expand description
A trie library for Rust that allows generic implementing a generic Trie.
A Trie actually does not store keys directly but supports storing the individual
fragments of what composes a key. For instance, a String trie will use char and will
have the signature Trie::<char, ()> (Trie).
The Trie supports the entire API of the standard library’s HashMap along with various common algorithms that a Trie data structure should support. This Trie implementation is optimized for extensibility and supporting many types and may not necessarily be the most memory optimized.
§Example
use rstrie::Trie;
let mut trie = Trie::<char, usize>::new();
trie.insert("hello".chars(), 4);
trie.insert("hey".chars(), 5);
assert_eq!(trie.get("hello".chars()), Some(&4));Structs§
- Completion
Iter - Drain
- Entry
Iter Mut - An iterator created by consuming the Trie. Contains all the entries of the Trie.
- Entry
Iter Ref - An iterator created by consuming the Trie.
- Into
Entry Iter - An iterator created by consuming the Trie.
- KeyIter
- An iterator created by consuming the Trie.
- Postfix
Iter - Trie
- A Trie is a data structure that is commonly used to store and retrieve strings in a memory-efficient manner. This crate takes a slightly different approach, allowing for the building of Tries from arbitrary types as long as they can satisfy certain properties.
- Value
Iter - An iterator created by consuming the Trie.
- Value
Iter Mut - An iterator over the values of a Trie that provides mutable references.
- Value
Iter Ref - An iterator over the values of a Trie.
- Value
Slot