easy-trie 0.1.4

A simple trie implementation in Rust
Documentation
  • Coverage
  • 70%
    7 out of 10 items documented7 out of 8 items with examples
  • Size
  • Source code size: 22.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 368.59 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • macmist/rust-trie
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • macmist

Simple Trie

Github Action Crate License

This is a simple rust trie library. Essentially, I wanted to understand how to create and publish a crate so I was looking for something simple but useful.

Installation

cargo add easy-trie

Examples

Simple case

use easy_trie::trie::Trie;

let mut trie = Trie::new();
trie.insert("hello");
assert_eq!(trie.len(), 5);
assert!(trie.contains("hello"));
assert!(!trie.contains("world"));

Suggestions

use easy_trie::trie::Trie;

let mut trie = Trie::new();
trie.insert("hello");
trie.insert("help");
let suggestions = trie.suggest("h");
assert!(suggestions.contains(&"hello".to_string()));
assert!(suggestions.contains(&"help".to_string()));