Crate ttrpc_codegen[][src]

API to generate .rs files for ttrpc from protobuf

use ttrpc_codegen::Codegen;
use ttrpc_codegen::Customize;

fn main() {
    Codegen::new()
        .out_dir("protocols/sync")
        .inputs(&protos)
        .include("protocols/protos")
        .rust_protobuf()
        .customize(Customize {
            ..Default::default()
        })
        .run()
        .expect("Gen code failed.");
}

Structs

Codegen

Invoke pure rust codegen.

Customize

Customize generated code.

ProtobufCustomize

Specifies style of generated code.