8 releases

0.2.0 Mar 15, 2024
0.1.4 Oct 4, 2023
0.1.3 Sep 21, 2023
0.0.3 Sep 14, 2023
0.0.2 Aug 9, 2023

#5 in #protokit

Download history 6/week @ 2023-12-24 3/week @ 2024-01-07 1/week @ 2024-01-14 1/week @ 2024-02-04 6/week @ 2024-02-11 2/week @ 2024-02-18 83/week @ 2024-02-25 20/week @ 2024-03-03 170/week @ 2024-03-10 45/week @ 2024-03-17 14/week @ 2024-03-24 50/week @ 2024-03-31 5/week @ 2024-04-07

195 downloads per month
Used in 7 crates (3 directly)

MIT license

34KB
827 lines

Protokit

crates.io img example workflow

Implementation of protocol buffers for rust.

Why not prost/pb-j/rust-protobuf?

Started with my need for proper textformat support.

any_value {
  [type.googleapis.com/com.example.SomeType] {
    field1: "hello"
  }
}

After I investigated other crates, I found out that they had other issues ( required boxing in rust-protobuf, messy codegen in prost).

Features

  • Binary(100% conformance) + Text(90% conformance) format support
  • No message boxing required
  • GRPC (usable with tonic)
  • Nice derive macro for creating message implementations without proto compiler:
#[derive(Default, Debug, Clone, BinProto)]
pub struct FieldPath {
    #[field(1, varint, packed)]
    pub fields: Vec<u32>,
}

#[derive(Default, Debug, Clone, BinProto)]
pub struct FieldMask {
    #[field(1, nested, repeated)]
    pub paths: Vec<FieldPath>,
}

Dependencies

~1–1.4MB
~27K SLoC