DEV Community

Discussion on: A beginners guide to gRPC with Rust

Collapse
 
anshulgoyal15 profile image
Anshul Goyal

Yes, the better way is to use cargo wrokspaces.

Collapse
 
wotzhs profile image
Sean Wong

Thanks Anshul, I have been looking at different gRPC crates and I think another way that to not use the cargo run --bin server is to use the statically generated code from protoc --rust_out and use them to build the grpc server manually.

Particularly I found github.com/tikv/grpc-rs.

I understood completely that this article was meant to demonstrate the dynamically genarated grpc server & client, so I hope this comment is not to be taken in the wrong light.

Thread Thread
 
anshulgoyal15 profile image
Anshul Goyal

Hi, Sean I always like to generate stubs at build time. It allows us to maintain a sync between protocol buffer definations and stubs. I think it is best practice to not to generate stubs before hand.

Thread Thread
 
wotzhs profile image
Sean Wong

yup, agreed, generating stub at build time guarantees the latest protobuf code, that's my preference too.