split_by

Crates.iosplit_by
lib.rssplit_by
version0.2.2
sourcesrc
created_at2016-08-30 14:45:03.320225
updated_at2018-04-11 23:03:17.498892
descriptionSplit anything implementing Read trait by multiple sequences of bytes
homepage
repositoryhttps://github.com/jsen-/split_by
max_upload_size
id6184
size22,327
(jsen-)

documentation

https://docs.rs/split_by

README

Latest Version

split_by

Split anything implementing Read trait by multiple sequences of bytes

Documentation

Quick start

Add this to Cargo.toml, under [dependencies]:

split_by = "0.2"

Usage

extern crate split_by;
use split_by::{AcAutomaton, SplitBy}
use std::fs::File;

fn main() {
    for section in File::open("path/to/file").unwrap().split_by(&AcAutomaton::new(vec!["<some pattern>"])) {
        let bytes = section.expect("read error occurred");
        // do something with the bytes found between patterns
    }
}
Commit count: 8

cargo fmt