# Crate of the Week

**URL:** <https://users.rust-lang.org/t/crate-of-the-week/2704>\
**Category:** community\
**Created:** [September 3, 2015, 3:41pm UTC](https://users.rust-lang.org/t/crate-of-the-week/2704 "2015-09-03T15:41:37Z")\
**Posts on this page:** 1\
**Showing post:** 1659

<div class="post-metadata">

**Author:** ![flo](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/flo/32/45413_2.png) [@flo](https://users.rust-lang.org/u/flo)\
**Post date:** [August 28, 2026, 8:39pm UTC](https://users.rust-lang.org/t/crate-of-the-week/2704/1659 "2026-08-28T20:39:39Z")

</div>

Hello, I'd like to purpose [BufReadSplitter](https://crates.io/crates/buf_read_splitter). A library to split (separate) a stream into sub-subtreams according to a defined pattern (an array of [u8] or other).

An example of usage :

```rust
use std::io::Read;
use buf_read_splitter::{BufReadSplitter,MatchResult,Options,SimpleMatcher};

let mut input_reader = .....

// Create a reader that will be separated by "<SEP>"
let mut reader = BufReadSplitter::new(
  &mut input_reader,
  SimpleMatcher::new(b"----------separator"),
  Options::default()
                  .set_limit_read(Some(1_024)), // 1ko max to avoid memory overload
                  .clone()
);

while reader.next().unwrap() {
  let mut content = Vec::new();
  let _ = reader.read_to_end(&mut content);
  // Treat content ... 
}

```

I'm proud of this little tool (well... the algorithm design was more complicated than excepted 😅 ) It has reached the stable state of version 1.0.0 ! Hope my efforts can be useful for others !! MIT license.

---

_[View the full topic](https://users.rust-lang.org/t/crate-of-the-week/2704)._
