pub trait JsonRpcResponse:
'static
+ Debug
+ Sized
+ Send
+ Clone {
// Required methods
fn into_json(self, method: &str) -> Result<Value, Error>;
fn from_value(method: &str, value: Value) -> Result<Self, Error>;
}Expand description
Defines the “payload” of a successful response to a JSON-RPC request.
§Derive Macro
Use #[derive(JsonRpcResponse)] to automatically implement this trait:
ⓘ
use agent_client_protocol::JsonRpcResponse;
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize, JsonRpcResponse)]
#[response(method = "_hello")]
struct HelloResponse {
greeting: String,
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl JsonRpcResponse for Value
impl JsonRpcResponse for Value
Implementors§
impl JsonRpcResponse for agent_client_protocol::AgentResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::AgentResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::AuthenticateResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::AuthenticateResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::ClientResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::ClientResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::CloseSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::CloseSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for ConnectMcpResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::CreateElicitationResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::CreateElicitationResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for CreateTerminalResponse
impl JsonRpcResponse for agent_client_protocol::schema::DeleteSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::DeleteSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for DisconnectMcpResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::ForkSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::ForkSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::InitializeResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::InitializeResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for KillTerminalResponse
impl JsonRpcResponse for agent_client_protocol::schema::ListSessionsResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::ListSessionsResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::LoadSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::LoadSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::LogoutResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::LogoutResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for McpConnectResponse
impl JsonRpcResponse for MessageMcpResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::NewSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::NewSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::PromptResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::PromptResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for ReadTextFileResponse
impl JsonRpcResponse for ReleaseTerminalResponse
impl JsonRpcResponse for agent_client_protocol::schema::RequestPermissionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::RequestPermissionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::ResumeSessionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::ResumeSessionResponse
Available on crate feature
unstable_protocol_v2 only.impl JsonRpcResponse for agent_client_protocol::schema::SetSessionConfigOptionResponse
impl JsonRpcResponse for agent_client_protocol::schema::v2::SetSessionConfigOptionResponse
Available on crate feature
unstable_protocol_v2 only.