libdawg 1.0.0

A fast, memory-efficient DAWG (Directed Acyclic Word Graph) for word validation and prefix queries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::Debug;
use std::hash::Hash;

/// Trait for types that can serve as edge labels in a DAWG.
///
/// This trait is automatically implemented for any type satisfying all the
/// required bounds (`char`, `u8`, `u16`, `u32`, etc.).
///
/// - `Copy`: edges store labels by value
/// - `Eq + Ord`: comparing and ordering edge labels
/// - `Hash`: node deduplication during DAWG construction
/// - `Debug`: debug printing of nodes
/// - `Default`: sentinel value for the builder's root node
pub trait DawgChar: Copy + Eq + Ord + Hash + Debug + Default {}

impl<T: Copy + Eq + Ord + Hash + Debug + Default> DawgChar for T {}