rpc: expose delegation types programmatically
Our existing code has an arti:x_list_all_rpc_methods
method that tells you, for each method, which objects it supports, what type instantiates it, and what types it returns.
Unfortunately, we built this before we added delegation, so its output is incomplete.
The working plan here is to have this information be exposed via the derive_deftly(Object)
template, as follows:
15:37 <+Diziet> How about this (just spitballing):
15:38 <+Diziet> Make the macro take a meta saying what the delegate concrete type is. Have it insist that the closure returns Arc<that type>
We may eventually need an escape hatch from this, but we can solve that when we come to it.
There are a bunch of possible ways for derive_deftly to expose this information. We can stick it in the docs for the impl Object for Foo
, and that might not be amiss. But we should probably also expose it programmatically, so we're not forcing our RPC documentation tool to extract delegations from rustdoc.