6 stable releases

Uses new Rust 2021

2.3.0 Jan 5, 2022
2.2.0 Jan 4, 2022
2.0.0 Dec 28, 2021
1.1.0 Dec 19, 2021

#304 in Rust patterns

Download history 28/week @ 2022-05-22 38/week @ 2022-05-29 32/week @ 2022-06-05 2/week @ 2022-06-12 8/week @ 2022-06-19 4/week @ 2022-06-26 13/week @ 2022-07-03 16/week @ 2022-07-10 12/week @ 2022-07-17 15/week @ 2022-07-24 15/week @ 2022-07-31 13/week @ 2022-08-07 6/week @ 2022-08-14 14/week @ 2022-08-21 6/week @ 2022-08-28 22/week @ 2022-09-04

52 downloads per month

MIT/Apache

81KB
1.5K SLoC

CURSOR Cursor logo

A more free Rust-Iterator.

CI Crates.io Licensed Twitter

| Examples | Docs | Latest Note |

[dependencies]
cursor = "2"
# { version = "2", default-features = false } == no-std

Cursor diagram

Examples

use cursor::*;

fn example7() -> u8 {

    let mut cursor = Cursor::new(&[1u8; 100]);
    cursor += 5;
    cursor -= 2;
    cursor += 1;

    cursor.current_deref()

}

fn example9() {

    let mut cursor = StrCursor::new("test입니다. ^^");
    cursor += 5;

    assert_eq!(cursor.as_preserved_str(), "test입");
    assert_eq!(cursor.current(), '');
    assert_eq!(cursor.as_remaining_str(), "다. ^^");

}

Please check the examples folder for detailed features.

No runtime deps