Expand description
§runtime‑macros
Procedural macros used by the runtime project to generate RPC stubs, strongly‑typed
message‑handlers, and boilerplate for object references at compile‑time.
They contain no runtime logic – their sole purpose is to expand user‑written async
functions and impl
blocks into the code required for inter‑runtime communication.
§What it generates
- A [
MessageHandler
] implementation that the runtime can dispatch. Input
andOutput
structs that implement [TypeInfo
] for binary serialization.- A tiny, ergonomic forwarding stub that performs the actual RPC call.
The generated pieces are completely hidden from the end‑user, giving them a clean API while retaining full type‑safety over the wire.
§Usage
Put async functions or methods inside an rpc! { ... }
block:
ⓘ
rpc! {
async fn add(a: i32, b: i32) -> i32 {
a + b
}
}
```.
Macros§
- rpc
- Procedural macro
rpc!
– transforms async functions and methods into remote‑callable RPC endpoints.