transition-table 0.0.3

transition table utilities for keyword parser.
Documentation
  • Coverage
  • 57.14%
    8 out of 14 items documented2 out of 12 items with examples
  • Size
  • Source code size: 7.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.28 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fton

pipeline status coverage report Latest Release

Description

This package provides the definition and utilities for the trie for the const array with &str key item.

Usage

use ::transition_table::*;

const KEYWORDS: [(&'static str, i8); 3] = [
    ("A", 1),
    ("BB", 2),
    ("BBC", 3),
];

let tree = Entry::<char, _>::new(KEYWORDS.iter());
let tbl: Vec<Transition<_, _, _>> = tree.into();
let mut it = tbl.iter();

assert_eq!(it.next().unwrap(), &('C', 0usize, 0usize, 2usize));
assert_eq!(it.next().unwrap(), &('B', 0usize, 1usize, 1usize));
assert_eq!(it.next().unwrap(), &('A', 0usize, 0usize, 0usize));
assert_eq!(it.next().unwrap(), &('B', 1usize, 2usize, !0usize));
assert_eq!(it.next().unwrap(), &('\u{0}', 2usize, 4usize, !0usize));
assert!(it.next().is_none());

Project status

This package is in the early stage.