containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

*_ttrpc.rs generate also can support gen_mod_rs. #231

Open jokemanfire opened 2 months ago

jokemanfire commented 2 months ago

Is your feature request related to a problem? Please describe. if I set ProtobufCustomize::default().gen_mod_rs(true); but .ttrpc.rs will not add in mod.rs. If _ttrpc.rs also can add in mod.rs. When I point out the gen_mod_rs(true).

Describe the solution you'd like

ttrpc_compiler::codegen::gen_and_write function support customize's gen_mod_rs ,and write it in mod.rs

Describe alternatives you've considered

pub fn gen_and_write( file_descriptors: &[FileDescriptorProto], files_to_generate: &[String], out_dir: &Path, customize: &Customize, ) -> io::Result<()> { let results = gen(file_descriptors, files_to_generate, customize); if results is not null and gen_mod_rs is true,add it in mod.rs .

Additional context

Before raising this feature request

yes