Struct fs_trie::Trie
[−]
[src]
pub struct Trie<V> { /* fields omitted */ }
The Trie struct. The children are a std::collections::HashMap
of other Tries.
Methods
impl<V> Trie<V>
[src]
fn load_from_file(path: &str) -> Result<Self, BincodeError> where
V: Serialize + Deserialize<'de>,
[src]
V: Serialize + Deserialize<'de>,
Returns a Trie
fn insert(&mut self, key: &str, contents: V) -> Option<V>
[src]
Inserts a Trie entry. The &str key is split into its chars to generate the children.
fn get(&self, key: &str) -> Option<&V>
[src]
Get an entry from the Trie. Traverses the trie with the chars in the key.
fn get_mut(&mut self, key: &str) -> Option<&mut V>
[src]
Get a mutable reference to the Trie entry. Use this to modify entries.
fn save_to_file(&mut self, path: &str) -> Result<(), BincodeError> where
V: Serialize + Deserialize<'de>,
[src]
V: Serialize + Deserialize<'de>,
Save the Trie to a file.