Skip to content
/ split_by Public

Split anything implementing Read trait by multiple sequences of bytes

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

jsen-/split_by

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    }
}

About

Split anything implementing Read trait by multiple sequences of bytes

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages