lazy-char-iter 0.1.0

Lazily iterate over Unicode characters from a u8 slice in Rust.
Documentation
  • Coverage
  • 90.91%
    10 out of 11 items documented3 out of 6 items with examples
  • Size
  • Source code size: 49.82 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.78 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • dacut/lazy-char-iter
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dacut

lazy-char-iter

Lazily iterate over Unicode characters from a u8 slice in Rust.

This crate provides a .chars() method for Vec<u8> and &[u8] types, allowing you to iterate over the characters in a byte vector or slice without decoding each character preemptively.

In typical usage, you use the LazyCharIterExt trait (implemented for Vec<u8> and &[u8]) and call the .chars() method on those types:

use lazy_char_iter::LazyCharIterExt;
let bread_str: &str = "brød";
let bread_bytes: &[u8] = bread_str.as_bytes();
let mut char_iter = bread_bytes.chars();
assert_eq!(char_iter.next(), Some(Ok('b')));