n0-computer / quic-rpc

A streaming rpc system based on quic
Other
89 stars 12 forks source link

refactor!: use `Service` generic in transport connections #76

Closed Frando closed 3 months ago

Frando commented 4 months ago

This changes the transport connection and endpoint struct to be generic over S: Service instead of In: RpcMessage, Out: RpcMessage. With this change, the public API surface of a crate using quic-rpc can be reduced to only make the service struct public and hide the RPC message types.

E.g. in Iroh, a quic client would now be Client<QuinnConnection<RpcService>> instead of Client<QuinnConnection<ProviderRequest, ProviderResponse>>

Breaking changes

The change breaks all transport types, they are now generic over S: Service instead of In: RpcMessage, Out: RpcMessage.

dignifiedquire commented 4 months ago

much nicer 🔥

rklaehn commented 3 months ago

OK, so I am trying to come up with cases where this is limiting, but so far can't find any. Also it seems that transport::Connection is unaffected and still has two type parameters. So LGTM.