pub fn build_rust_code_from_protobuffer_with_options(proto_filename: &PathBuf, includes: Vec<String>, rpc_generator: pb_rs::types::RpcGeneratorFunction) -> Result<PathBuf, Error> {
	use pb_rs::types::Config;
	log::info!("Building protobuf for {:?}...", &proto_filename);

	let out_dir = autogen_dir();
	std::fs::create_dir_all(&out_dir)?;
	let out_file = get_protobuf_generated_filename(proto_filename);
	log::info!("Generating {:?}.", out_file);

    let config = Config {
        in_file: proto_filename.to_owned(),
        out_file: out_file.clone(), 
        single_module: true,
        import_search_path: vec![PathBuf::from("./schema")],
        no_output: false,
        error_cycle: false,
        headers: true,
		dont_use_cow: true,
        custom_struct_derive: vec!["derive_new::new".into()], //, "Eq".into(), "Hash".into()],
        custom_rpc_generator: rpc_generator,
		custom_includes: includes,
    };

    if let Err(e) = pb_rs::types::FileDescriptor::write_proto(&config) {
		return Err(failure::format_err!("{:?}", e));
	}

	log::info!("...Pb-rs ran on {:?} and created {:?}", proto_filename, out_file);

	Ok(out_file)
}
/// Call protoc on protobuffer and create non-rpc code
Call protoc on protobuffer and create non-rpc code
Call protoc on protobuffer and create non - rpc code
pub fn build_rust_code_from_protobuffer_with_options(proto_filename: &PathBuf, includes: Vec<String>, rpc_generator: pb_rs::types::RpcGeneratorFunction) -> Result<PathBuf, Error> {
	use pb_rs::types::Config;
	log::info!("Building protobuf for {:?}...", &proto_filename);
	let out_dir = autogen_dir();
	std::fs::create_dir_all(&out_dir)?;
	let out_file = get_protobuf_generated_filename(proto_filename);
	log::info!("Generating {:?}.", out_file);
    let config = Config {
        in_file: proto_filename.to_owned(),
        out_file: out_file.clone(), 
        single_module: true,
        import_search_path: vec![PathBuf::from("./schema")],
        no_output: false,
        error_cycle: false,
        headers: true,
		dont_use_cow: true,
        custom_struct_derive: vec!["derive_new::new".into()], //, "Eq".into(), "Hash".into()],
        custom_rpc_generator: rpc_generator,
		custom_includes: includes,
    };
    if let Err(e) = pb_rs::types::FileDescriptor::write_proto(&config) {
		return Err(failure::format_err!("{:?}", e));
	}
	log::info!("...Pb-rs ran on {:?} and created {:?}", proto_filename, out_file);
	Ok(out_file)
}
pub fn build_rust_code_from_protobuffer_with_options ( proto_filename : & PathBuf , includes : Vec < String > , rpc_generator : pb_rs :: types :: RpcGeneratorFunction ) -> Result < PathBuf , Error > { use pb_rs :: types :: Config ; log :: info ! ( " " proto_filename ) ; let out_dir = autogen_dir ( ) ; std :: fs :: create_dir_all ( & out_dir ) ? ; let out_file = get_protobuf_generated_filename ( proto_filename ) ; log :: info ! ( " " out_file ) ; let config = Config { in_file : proto_filename . to_owned ( ) , out_file : out_file . clone ( ) , single_module : true , import_search_path : vec ! [ PathBuf from ( " " ) ] , no_output : false , error_cycle : false , headers : true , dont_use_cow : true , custom_struct_derive : vec ! [ " " into ( ) ] , //, "Eq".into(), "Hash".into()], custom_rpc_generator : rpc_generator , custom_includes : includes , } ; if let Err ( e ) = pb_rs :: types :: FileDescriptor :: write_proto ( & config ) { return Err ( failure :: format_err ! ( " " e ) ) ; } log :: info ! ( " " proto_filename out_file ) ; Ok ( out_file ) }
Call protoc on protobuffer and create non-rpc code
Call protoc on protobuffer and create non - rpc code
proto_filename
&PathBuf
includes
Vec<String>
rpc_generator
pb_rs::types::RpcGeneratorFunction