Crate ttrpc_codegen

Source
Expand description

API to generate .rs files for ttrpc from protobuf

use ttrpc_codegen::{Customize, Codegen, ProtobufCustomize};

fn main() {
    let protobuf_customized = ProtobufCustomize::default().gen_mod_rs(false);

    Codegen::new()
        .out_dir("protocols/asynchronous")
        .inputs(&protos)
        .include("protocols/protos")
        .rust_protobuf()
        .customize(Customize {
            async_all: true,
            ..Default::default()
        })
        .rust_protobuf_customize(protobuf_customized.clone())
        .run()
        .expect("Gen async code failed.");
 }

If there’s no out_dir and use ‘gen_mod’ feature You can use the following method to include the target file include!(concat!(env!(“OUT_DIR”), “/mod.rs”));

Structs§

  • Invoke pure rust codegen.
  • Customize generated code.
  • Specifies style of generated code. Generated files can be customized using this proto or using rustproto.proto options.

Traits§

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy