2 releases

new 0.1.2 May 9, 2025
0.1.1 May 9, 2025
0.1.0 May 9, 2025

#1575 in Encoding

34 downloads per month

MIT license

565KB
263 lines

pbbson-rs

Utilities for pbjson to BSON conversions.

License Arch

Installing

$ cargo add pbbson

Testing

$ make check

Using

Convert a Prost Protobuf message into a BSON Document

use bson::Document;
use pbbson::Model;

let doc: Document = Model::try_from(&message).unwrap().into();

Convert a BSON Document into a Prost Protobuf message

let my_struct: StructType = model.try_into().unwrap();

Dependencies

~9–19MB
~245K SLoC