regex-chunker
Splitting output from Read types with regular expressions.
The chief type in this crate is the
ByteChunker,
which wraps a type that implements
Read
and iterates over chunks of its byte stream delimited by a supplied
regular expression. The following example reads from the standard input
and prints word counts:
use BTreeMap;
use ByteChunker;
The async feature enables the stream submodule, which contains an
asynchronous version of ByteChunker that wraps an
tokio::io::AsyncRead
type and produces a
Stream
of byte chunks.
Running The Tests
If you want to run the tests for the async features, you need to first
build src/bin/slowsource.rs with the async and test feature enabled:
Some of the [stream] module tests run it in a subprocess and use it as
a source of bytes.
Unanswered Questions and Stuff To do
This is, as of yet, an essentially naive implementation. What can be done to optimize performance?
Is there room to tighten up the RcErr type?
When non-overlapping blanket impls
(1672,
maybe 20400) land, remove both the
SimpleCustomChunker types.