feat(build): Expose Prost generation plugin (#947)

This commit is contained in:
Tuetuopay
2022-03-31 20:52:38 +02:00
committed by GitHub
parent 9dab8be5fc
commit d4bd4758dd
+7 -1
View File
@@ -412,10 +412,16 @@ impl Builder {
config.protoc_arg(arg);
}
config.service_generator(Box::new(ServiceGenerator::new(self)));
config.service_generator(self.service_generator());
config.compile_protos(protos, includes)?;
Ok(())
}
/// Turn the builder into a `ServiceGenerator` ready to be passed to `prost-build`s
/// `Config::service_generator`.
pub fn service_generator(self) -> Box<dyn prost_build::ServiceGenerator> {
Box::new(ServiceGenerator::new(self))
}
}