protokit

Crates.ioprotokit
lib.rsprotokit
version0.2.0
sourcesrc
created_at2022-10-04 17:37:49.885037
updated_at2024-03-15 22:01:58.733902
descriptionUsable protocol buffers
homepage
repositoryhttps://github.com/semtexzv/protokit
max_upload_size
id679989
size4,044
Michal Hornický (semtexzv)

documentation

README

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>,
}
Commit count: 76

cargo fmt