Expand description
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.
Re-exports§
pub use bit_cast::BitCast;
Modules§
- All encoding and decoding is done via u64. So all types must implement this trait to be able to be encoded and decoded.
Structs§
- The
Fieldstruct contains a tag and a type. The tag is used to track the data type in the message for decoding. The type is used to determine how to encode and decode the field. - The
Protobufstruct is used to read and write protobuf messages.
Enums§
- The
Typeenum represents the different types that a field can have in a protobuf message. TheTypeenum is used to determine how to encode and decode the field.
Traits§
- The
ProtoReadtrait is used to read a protobuf message. This crate forces the user to implement this trait in order to read a protobuf message. - The
ProtoWritetrait is used to write a protobuf message. This crate forces the user to implement this trait in order to write a protobuf message.
Functions§
- convert an unsigned integer to a signed integer using zigzag decoding.
- convert a signed integer to an unsigned integer using zigzag encoding.