Skip to main content

Crate server_less_rpc

Crate server_less_rpc 

Source
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§

AsyncHandling
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::Value args 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.