5 releases (2 stable)
|new 1.1.0||Jan 13, 2021|
|1.0.0||Apr 25, 2020|
|0.99.0||Apr 11, 2020|
|0.99.0-dev.3||Mar 26, 2020|
|0.99.0-dev.2||Mar 19, 2020|
#140 in Text processing
16,517 downloads per month
Used in 44 crates (5 directly)
A library that provides newtype wrappers for
(u32, u32) for use as text offsets.
See the docs for more.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Newtypes for working with text sizes/ranges in a more type-safe manner.
This library can help with two things:
- Reducing storage requirements for offsets and ranges, under the assumption that 32 bits is enough.
- Providing standard vocabulary types for applications where text ranges are pervasive.
However, you should not use this library simply because you work with
strings. In the overwhelming majority of cases, using
std::ops::Range<usize> is better. In particular, if you are publishing a
library, using only std types in the interface would make it more
interoperable. Similarly, if you are writing something like a lexer, which
produces, but does not store text ranges, then sticking to
Minimal Supported Rust Version: latest stable.