google / tarpc

An RPC framework for Rust with a focus on ease of use.
MIT License
3.09k stars 189 forks source link

Converge (just a little) the Stub and Serve traits #434

Closed tikue closed 5 months ago

tikue commented 5 months ago

I don't think we'll ever completely unify these two traits, since one takes self by reference and one by value. However, we can actually get pretty close and have Serve + Clone types impl Stub. I don't remember the original motiviation of https://github.com/google/tarpc/issues/251, but I think there are probably more use cases for services acting as Stubs than vice versa.

Fixes https://github.com/google/tarpc/issues/251