I digged out some macro_rules code for RPC interface declarations that I wrote for an RPC experiment a while back. It was quite straightforward to adapt to quic-rpc, combined it with the request_enum macro from examples/store.rs and then got lost a bit and made the store example work.
The macros are completely optional. They also do not introduce any traits, because async traits would require boxing the futures, and so far quic-rpc works without, which is nice.
All idents have to be passed in the macro call. I think that's a feature because less magic. The invocation of derive_rpc_service! in examples/macro.rs quite literally creates the code that can be seen in examples/store.rs.
I digged out some macro_rules code for RPC interface declarations that I wrote for an RPC experiment a while back. It was quite straightforward to adapt to quic-rpc, combined it with the
request_enum
macro fromexamples/store.rs
and then got lost a bit and made thestore
example work.The macros are completely optional. They also do not introduce any traits, because async traits would require boxing the futures, and so far
quic-rpc
works without, which is nice.All idents have to be passed in the macro call. I think that's a feature because less magic. The invocation of
derive_rpc_service!
inexamples/macro.rs
quite literally creates the code that can be seen inexamples/store.rs
.