| Crates.io | dyn_trie |
| lib.rs | dyn_trie |
| version | 3.0.6 |
| created_at | 2024-07-21 21:49:32.084524+00 |
| updated_at | 2025-06-05 20:06:59.401929+00 |
| description | Dynamic trie is trie capable of mapping any T to any char iterator. |
| homepage | |
| repository | https://github.com/deep-outcome/tries/tree/main/dyn_trie |
| max_upload_size | |
| id | 1310601 |
| size | 63,148 |
Dynamic trie is trie that allows mapping of any T to any char iterator with asymptotical computational complexity based on that of std::collections::HashMap.
Node occurs for each char as defined by Rust language.
let mut trie = Trie::<char>::new();
let some = "información meteorológica".chars();
trie.ins('🌩', some.clone());
let one_more = "alimentación RSS".chars();
trie.ins('😋', one_more.clone());
assert_eq!(RemRes::Ok('😋'), trie.rem(one_more.clone()));
assert_eq!(AcqRes::Err(KeyErr::Unknown), trie.acq(one_more.clone()));
let mut res = trie.acq_mut(some.clone());
assert_eq!(AcqMutRes::Ok(&mut '🌩'), res);
let entry = res.uproot();
*entry = '🌞';
assert_eq!(AcqRes::Ok(&'🌞'), trie.acq(some.clone()));