pub trait JsonRpcRequest: JsonRpcMessage {
type Response: JsonRpcResponse;
}Expand description
A struct that represents a request (JSON-RPC message expecting a response).
§Derive Macro
Use #[derive(JsonRpcRequest)] to automatically implement both JsonRpcMessage and JsonRpcRequest:
ⓘ
use agent_client_protocol::{JsonRpcRequest, JsonRpcResponse};
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, Serialize, Deserialize, JsonRpcRequest)]
#[request(method = "_hello", response = HelloResponse)]
struct HelloRequest {
name: String,
}
#[derive(Debug, Serialize, Deserialize, JsonRpcResponse)]
struct HelloResponse {
greeting: String,
}Required Associated Types§
Sourcetype Response: JsonRpcResponse
type Response: JsonRpcResponse
The type of data expected in response.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl JsonRpcRequest for agent_client_protocol::AgentRequest
impl JsonRpcRequest for agent_client_protocol::AgentRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::AgentRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::AgentRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::AuthenticateRequest
impl JsonRpcRequest for agent_client_protocol::schema::AuthenticateRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::AuthenticateRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::AuthenticateRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::ClientRequest
impl JsonRpcRequest for agent_client_protocol::ClientRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::ClientRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::ClientRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::CloseSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::CloseSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::CloseSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::CloseSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for ConnectMcpRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for ConnectMcpRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::CreateElicitationRequest
impl JsonRpcRequest for agent_client_protocol::schema::CreateElicitationRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::CreateElicitationRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::CreateElicitationRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::DeleteSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::DeleteSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::DeleteSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::DeleteSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for DisconnectMcpRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for DisconnectMcpRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::ForkSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::ForkSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::ForkSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::ForkSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::InitializeRequest
impl JsonRpcRequest for agent_client_protocol::schema::InitializeRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::InitializeRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::InitializeRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::ListSessionsRequest
impl JsonRpcRequest for agent_client_protocol::schema::ListSessionsRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::ListSessionsRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::ListSessionsRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::LoadSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::LoadSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::LoadSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::LoadSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::LogoutRequest
impl JsonRpcRequest for agent_client_protocol::schema::LogoutRequest
type Response = LogoutResponse
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::LogoutRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::LogoutRequest
Available on crate feature
unstable_protocol_v2 only.type Response = LogoutResponse
Source§impl JsonRpcRequest for McpConnectRequest
impl JsonRpcRequest for McpConnectRequest
Source§impl JsonRpcRequest for MessageMcpRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for MessageMcpRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::NewSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::NewSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::NewSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::NewSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::PromptRequest
impl JsonRpcRequest for agent_client_protocol::schema::PromptRequest
type Response = PromptResponse
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::PromptRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::PromptRequest
Available on crate feature
unstable_protocol_v2 only.type Response = PromptResponse
Source§impl JsonRpcRequest for agent_client_protocol::schema::RequestPermissionRequest
impl JsonRpcRequest for agent_client_protocol::schema::RequestPermissionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::RequestPermissionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::RequestPermissionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::ResumeSessionRequest
impl JsonRpcRequest for agent_client_protocol::schema::ResumeSessionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::ResumeSessionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::ResumeSessionRequest
Available on crate feature
unstable_protocol_v2 only.Source§impl JsonRpcRequest for agent_client_protocol::schema::SetSessionConfigOptionRequest
impl JsonRpcRequest for agent_client_protocol::schema::SetSessionConfigOptionRequest
Source§impl JsonRpcRequest for agent_client_protocol::schema::v2::SetSessionConfigOptionRequest
Available on crate feature unstable_protocol_v2 only.
impl JsonRpcRequest for agent_client_protocol::schema::v2::SetSessionConfigOptionRequest
Available on crate feature
unstable_protocol_v2 only.