8 releases

0.2.0 Mar 15, 2024
0.1.4 Oct 4, 2023
0.1.3 Sep 21, 2023
0.1.0 Oct 4, 2022
0.0.2 Aug 9, 2023

#1010 in Network programming

Download history 89/week @ 2024-02-23 30/week @ 2024-03-01 10/week @ 2024-03-08 151/week @ 2024-03-15 7/week @ 2024-03-22 9/week @ 2024-03-29

177 downloads per month

MIT license

80KB
2K SLoC

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

~2–15MB
~146K SLoC