crystalorb
crystalorb copied to clipboard
De-generalize Connection::send to simplify NetworkResource implementations
See #7 for rationale.
This would allow us to get rid of TypeId
uses in crystalorb-mock-network
, for example.
We can probably follow the similar approach to the way we de-generalized recv
by having separate methods (e.g. send_snapshot
, send_command
). This might be slightly nicer than using an enum and a single send
method because it is slightly weird that the enum would only be used for send
and not for recv
. The asymmetry between send
and recv
might give a bit more cognitive load when others try to read the code.