#protobuf #tonic #rpc

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

#106 in #tonic

Download history 46/week @ 2025-10-13 44/week @ 2025-10-20 23/week @ 2025-10-27 16/week @ 2025-11-03 22/week @ 2025-11-10 17/week @ 2025-11-17 11/week @ 2025-11-24 2/week @ 2025-12-01 2/week @ 2025-12-08 6/week @ 2025-12-15 41/week @ 2025-12-22 143/week @ 2025-12-29 260/week @ 2026-01-05 352/week @ 2026-01-12 489/week @ 2026-01-19 282/week @ 2026-01-26

1,404 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

~145–540KB
~13K SLoC