Skip to content

Commit d4bd475

Browse files
authored
feat(build): Expose Prost generation plugin (#947)
1 parent 9dab8be commit d4bd475

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tonic-build/src/prost.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,16 @@ impl Builder {
412412
config.protoc_arg(arg);
413413
}
414414

415-
config.service_generator(Box::new(ServiceGenerator::new(self)));
415+
config.service_generator(self.service_generator());
416416

417417
config.compile_protos(protos, includes)?;
418418

419419
Ok(())
420420
}
421+
422+
/// Turn the builder into a `ServiceGenerator` ready to be passed to `prost-build`s
423+
/// `Config::service_generator`.
424+
pub fn service_generator(self) -> Box<dyn prost_build::ServiceGenerator> {
425+
Box::new(ServiceGenerator::new(self))
426+
}
421427
}

0 commit comments

Comments
 (0)