Open AndreMouche opened 7 years ago
Indeed it is not supported for the moment and there is no short term plan to support it (support goes beyond simple protobuf serialization/deserialization).
On the other hand, I'd be happy to make any modification you think would be missing for another crate to implement it fully (i.e. providing some simple rust structs/traits). The code generation part should be relatively simple.
just generating the traits would be very helpful!
Prost has a config for plugging in an external service generator: https://docs.rs/prost-build/0.3.2/prost_build/struct.Config.html#method.service_generator
That seems like another solution.
I am not a big fan to be honest, I believe it doesn't fit too well with rust.
I think i prefer a trait based approach, or even a sync and an async which would use Future
(you can decide in config which one suits you the best)
pub trait HelloService {
type Error;
fn SayHello(_req: &HelloRequest) -> Result<HelloRespone, Self::Error>;
}
pub trait HelloServiceAsync {
type Error;
type Response: Future<Item = HelloResponse, Error = Self::Error>;
fn SayHello(_req: &HelloRequest) -> Self::Response;
}
That being said, I am open to any solution at the moment because I don't plan on working on this right now.
Would it support
service
one day, it seems not work for the following situation: