Simple tonic/prost example A simple tonic repo setup Using gRPC usually requires both client & server to have same protobuf definition. Client and server usually are not defined in the same repository.
We can use a separate git repository to store the protobuf definition, and using the git submodule to include the protobuf definition in the corresponding client and server.
Check sample repo to see how to setup
A simple prost example Sometime you only want to use protobuf to do serializing and deserializing the message, nothing else. In this case, you will need to use prost only.
Here is a simplest example of how to do that.
0001-01-01
329 words
2 minutes
rust CS Rust String.push(char) takes char Vec has reverse method where as iterator has rev method String and &str both have chars method that convert string to Char String and &str can be split_whitespace they also can call split(pat: P) e.g split(' ') is equivalent to split by whitespace NOTE: in rust usize -1 could overflow to max, this might causing algorithm not working properly If we are dealing with linked list with Option<Box<Node>>, we can potentially using Box::clone() to overcome some limitation due to borrow checker. Box::clone should be relatively not expensive as mentioned in rust book: a box is a smart pointer to a heap allocated value of T.