#protobuf

macro proto

proto allows you to define Protocol Buffers using Rust code to reuse Rust’s type system and ecosystem

3 releases

0.1.2 May 26, 2024
0.1.1 May 26, 2024
0.1.0 May 26, 2024

#1696 in Procedural macros

Download history 423/week @ 2024-07-22 156/week @ 2024-07-29 183/week @ 2024-08-05 150/week @ 2024-08-12 125/week @ 2024-08-19 104/week @ 2024-08-26 32/week @ 2024-09-02 5/week @ 2024-09-09 13/week @ 2024-09-16 46/week @ 2024-09-23 14/week @ 2024-09-30 9/week @ 2024-10-07 9/week @ 2024-10-14 17/week @ 2024-10-21 13/week @ 2024-10-28 17/week @ 2024-11-04

57 downloads per month
Used in 2 crates (via astro-run-protocol)

MIT license

14KB
348 lines

proto

proto allows you to define Protocol Buffers using Rust code to reuse Rust's type system and ecosystem.

Example

use proto::proto;

fn main() {
  // Define a Protocol Buffers service
  let service = proto! {
    package example;
    codec crate::common::JsonCodec;

    service Greeter {
      rpc SayHello (crate::HelloRequest) returns (stream crate::HelloResponse) {}
    }
  };

  tonic_build::manual::Builder::new()
    .out_dir("./pb")
    .compile(&[service]);
}

Dependencies

~260–710KB
~17K SLoC