#string #grapheme #cursor #unicode #str

strcursor

Provides a string cursor type for seeking through a string whilst respecting grapheme cluster and code point boundaries

7 releases

Uses old Rust 2015

0.2.5 Mar 20, 2017
0.2.4 Mar 16, 2017
0.2.3 Mar 5, 2016
0.2.2 Feb 9, 2016
0.1.0 Jun 22, 2015

#972 in Text processing

Download history 87/week @ 2024-07-21 283/week @ 2024-07-28 274/week @ 2024-08-04 167/week @ 2024-08-11 127/week @ 2024-08-18 138/week @ 2024-08-25 401/week @ 2024-09-01 151/week @ 2024-09-08 136/week @ 2024-09-15 152/week @ 2024-09-22 205/week @ 2024-09-29 239/week @ 2024-10-06 459/week @ 2024-10-13 150/week @ 2024-10-20 149/week @ 2024-10-27 224/week @ 2024-11-03

988 downloads per month
Used in 12 crates (3 directly)

MIT/Apache

66KB
1.5K SLoC

strcursor

Note: This is something of a work-in-progress. It has tests, but hasn't been exhaustively vetted.

This crate provides a "cursor" type for string slices. It provides the ability to safely seek back and forth through a string without worrying about producing invalid UTF-8 sequences, or splitting grapheme clusters.

In addition, it provides types to represent single grapheme clusters (Gc) and GcBuf) as distinct from arbitrary string slices.

See the StrCursor type for details.

Links

Compatibility

strcursor is currently supported on rustc version 1.1.0 and higher.

  • rustc < 1.4 will use a larger, less space-efficient implementation of GcBuf; rather than being the same size as Box<str>, it will be the same size as String.

  • rustc < 1.1 is not supported, due to a mysterious compiler crash.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~410KB