Skip to main content

JsonRpcNotification

Derive Macro JsonRpcNotification 

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

Derive macro for implementing JsonRpcNotification and JsonRpcMessage traits.

§Attributes

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

§Example

#[derive(Debug, Clone, Serialize, Deserialize, JsonRpcNotification)]
#[notification(method = "_ping")]
struct PingNotification {
    timestamp: u64,
}