Expand description
Shared utilities for RPC-style macros (MCP, WebSocket, JSON-RPC).
These macros use JSON-RPC-like dispatch:
- Receive
{"method": "name", "params": {...}} - Extract params from JSON
- Call the method
- Serialize result back to JSON
Enums§
- Async
Handling - How to handle async methods.
Functions§
- generate_
all_ param_ extractions - Generate all param extractions for a method.
- generate_
dispatch_ arm - Generate a complete dispatch match arm for an RPC method.
- generate_
dispatch_ arm_ with_ injections - Generate a dispatch arm with support for injected parameters.
- generate_
json_ response - Generate response handling that converts the method result to JSON.
- generate_
method_ call - Generate the method call expression.
- generate_
method_ call_ with_ args - Generate method call with custom argument expressions.
- generate_
param_ extraction - Generate code to extract a parameter from a
serde_json::Valueargs object. - generate_
param_ extractions_ for - Generate param extractions for specific parameters only.
- generate_
param_ schema - Generate JSON schema properties for method parameters.
- generate_
param_ schema_ for - Generate JSON schema properties for specific parameters (e.g., excluding Context).
- infer_
json_ type - Infer JSON schema type from Rust type using AST inspection.