Skip to main content

JsonRpcRequest

Derive Macro JsonRpcRequest 

Source
#[derive(JsonRpcRequest)]
{
    // Attributes available to this derive:
    #[request]
}
Expand description

Derive macro for implementing JsonRpcRequest and JsonRpcMessage traits.

§Attributes

  • #[request(method = "method_name", response = ResponseType)]
  • #[request(method = "method_name", response = ResponseType, crate = crate)] - for use within the agent_client_protocol crate

§Example

#[derive(Debug, Clone, Serialize, Deserialize, JsonRpcRequest)]
#[request(method = "_hello", response = HelloResponse)]
struct HelloRequest {
    name: String,
}