This module provides a procedural macro for automatically implementing the RPC boilerplate given a Rust trait. For an example see the smoke test. It currently uses RefCell, so single threaded usage is assumed (This can change if needed, but we would want to specify single vs multi-threaded).
To apply the macro:
#[sirenia_rpc]
before the trait definition.type Error
field.Clone
, Debug
, Deserialize
, and Serialize
(Clone
can possibly be dropped in the future).Once applied to a trait MyTrait
the macro provides:
MyTraitServer
traitMyTraitClient
struct that wraps a libsirenia::transport::Transport
object.libsirenia::rpc::MessageHandler
for Box<dyn MyTraitServer>
and MyTrait
for MyTraitClient
.