proto

Crates.ioproto
lib.rsproto
version0.1.2
sourcesrc
created_at2024-05-26 07:49:22.323358
updated_at2024-05-26 12:30:14.610338
description`proto` allows you to define Protocol Buffers using Rust code to reuse Rust's type system and ecosystem.
homepagehttps://github.com/panghu-huang/proto
repositoryhttps://github.com/panghu-huang/proto
max_upload_size
id1252392
size14,558
Panghu (panghu-huang)

documentation

README

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]);
}
Commit count: 3

cargo fmt