https://github.com/cad97/mileage
https://github.com/cad97/mileage
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cad97/mileage
- Owner: CAD97
- Created: 2019-07-25T02:25:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-15T19:19:50.000Z (almost 3 years ago)
- Last Synced: 2025-01-24T16:10:28.243Z (over 1 year ago)
- Language: Rust
- Size: 1.68 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mileage
This crate is deprecated, as there are better ways of accomplishing its contributions now.
- `CharRange` is a simple range of codepoints, effectively `std::ops::RangeInclusive`.
The std ranges have supported iterating `char` for a long time now.
- `CharSet` is a set of codepoints handled as a sorted vector of compact ranges.
`icu_collections` provides a `CodePointInversionList`.
- `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 a `CodePointTrie` with map functionality.
## Features
- `set`: Adds the `CharSet` type.
- `trie`: Adds the `CharTrie` type.
- `map`: Adds the `CharMap` reference type.
- `owned-set`: Adds the `CharSetBuf` type.
- `new-trie`: Adds code generation support for `CharTrie`s.
- `par-iter`: Adds implementations of `rayon::IntoParallelIterator`.
## Example
```rust
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`