Reimplement protobuf codec and library in Rust