2 releases
0.1.1 | Sep 15, 2023 |
---|---|
0.1.0 | Aug 23, 2019 |
#8 in #code-point
50KB
1K
SLoC
mileage
This crate is deprecated, as there are better ways of accomplishing its contributions now.
CharRange
is a simple range of codepoints, effectivelystd::ops::RangeInclusive<char>
. The std ranges have supported iteratingchar
for a long time now.CharSet
is a set of codepoints handled as a sorted vector of compact ranges.icu_collections
provides aCodePointInversionList
.CharTrie
is a static set of codepoints optimized for wide codepoint coverage. The simpler inversion list is usually sufficient.CharMap
is a mapping from (ranges of) codepoints to values.icu_collections
provides aCodePointTrie
with map functionality.
Features
set
: Adds theCharSet
type.trie
: Adds theCharTrie
type.map
: Adds theCharMap
reference type.owned-set
: Adds theCharSetBuf
type.new-trie
: Adds code generation support forCharTrie
s.par-iter
: Adds implementations ofrayon::IntoParallelIterator
.
Example
fn main() {
use mileage::CharRange;
for ch in CharRange::from('a'..='z') {
// ch is each codepoint in lowercase ascii in sorted order
dbg!(ch);
}
for ch in CharRange::from(..) {
// ch is every valid char in sorted order
dbg!(ch);
}
}
Planned (eventually)
CharMapRefMut
CharMapBuf
Dependencies
~0–760KB
~16K SLoC