pbf-rs
The pbf Rust crate provides functionalities to read and write Protocol Buffers (protobuf) messages. This crate is a 0 dependency package that uses no_std and is intended to be used in embedded systems and WASM applications. The crate is designed to be small and efficient, with the cost of some features and flexibility. It is up to the user to create the necessary data structures and implement the ProtoRead and ProtoWrite traits in order to use it effectively.
Usage
Add the following to your Cargo.toml:
[]
= "0.1"
Examples
use ;
let mut pb = new;
let msg = new;
pb.write_message;
let bytes = pb.take;
let mut pb = from_input;
// first read in the field for the message
let field = pb.read_field;
assert_eq!;
let mut msg = default;
pb.read_message;
assert_eq!;
assert_eq!;
Development
Requirements
You need the tool tarpaulin to generate the coverage report. Install it using the following command:
The bacon coverage tool is used to generate the coverage report. To utilize the pycobertura package for a prettier coverage report, install it using the following command:
Running Tests
To run the tests, use the following command:
# bacon
Generating Coverage Report
To generate the coverage report, use the following command:
# bacon