rust-protobuf
rust-protobuf copied to clipboard
Parse from bytes::Bytes iterator
Solve my #611 .
BytesIteratorReader
lacks document and test, please tell me the convention to add them.
There's an issue with this PR.
This PR does reading by wrapping Iterator<&Bytes>
into Read
. Which means CodedInputStream
has no option to reuse underlying Bytes
objects without copying them into memory. When CodedInputStream
is constructed from Bytes
, and when Bytes
is requested (when tokio_bytes
codegen option is used, see CodedInputStream::read_raw_tokio_bytes
function), the generated messages bytes reference original Bytes
object allocation, not create new allocation (which might be much more efficient).
In current form the PR does nothing which cannot be done outside of the crate.