#rpc #protobuf #tonic

proto

proto 允许您使用Rust代码定义协议缓冲区,以重用Rust的类型系统和生态系统

3个版本

0.1.2 2024年5月26日
0.1.1 2024年5月26日
0.1.0 2024年5月26日

#311 in #protobuf

Download history • Rust 包仓库 335/week @ 2024-05-24 • Rust 包仓库 55/week @ 2024-05-31 • Rust 包仓库 29/week @ 2024-06-07 • Rust 包仓库 15/week @ 2024-06-14 • Rust 包仓库 4/week @ 2024-06-21 • Rust 包仓库 28/week @ 2024-06-28 • Rust 包仓库 142/week @ 2024-07-05 • Rust 包仓库 176/week @ 2024-07-12 • Rust 包仓库 454/week @ 2024-07-19 • Rust 包仓库 192/week @ 2024-07-26 • Rust 包仓库 118/week @ 2024-08-02 • Rust 包仓库 169/week @ 2024-08-09 • Rust 包仓库

968 个月下载量
2 个crate中使用(通过astro-run-protocol

MIT 协议

14KB
348

proto

proto 允许您使用Rust代码定义协议缓冲区,以重用Rust的类型系统和生态系统。

示例

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]);
}

依赖项

~260–710KB
~17K SLoC