Skip to main content

Crate am_wordlist

Crate am_wordlist 

Source
Expand description

A fast, embedded word list you can index, with zero runtime init and zero allocation.

The whole list is baked into the binary at compile time, with each word’s start offset computed ahead of time in build.rs, so indexed lookup is a plain slice. The list is sorted and duplicate-free, so position, contains and starting_with are binary searches over it.

Constants§

LEN
How many words there are.

Functions§

contains
Whether the list contains a word. O(log n), no allocation.
get
Look up a single word by index. O(1), no allocation. Out of range is None.
get_range
Look up a contiguous range of words as an allocation-free iterator.
is_empty
iter
Iterate over every word in order. O(1) to set up, no allocation.
len
position
Find a word’s index. O(log n), no allocation. Not found is None.
starting_with
Iterate over every word starting with prefix, in order. O(log n) to set up, no allocation.