#[non_exhaustive]pub enum ClientResponse {
RequestPermissionResponse(Box<RequestPermissionResponse>),
CreateElicitationResponse(Box<CreateElicitationResponse>),
MessageMcpResponse(Box<MessageMcpResponse>),
ExtMethodResponse(Box<ExtResponse>),
}unstable_protocol_v2 only.Expand description
All possible responses that a client can send to an agent.
This enum is used internally for routing RPC responses. You typically won’t need to use this directly - the responses are handled automatically by the connection.
These are responses to the corresponding AgentRequest variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RequestPermissionResponse(Box<RequestPermissionResponse>)
Successful result returned for a session/request_permission request.
CreateElicitationResponse(Box<CreateElicitationResponse>)
Successful result returned for a elicitation/create request.
MessageMcpResponse(Box<MessageMcpResponse>)
unstable_mcp_over_acp only.Successful result returned by an MCP-over-ACP mcp/message request.
ExtMethodResponse(Box<ExtResponse>)
Successful result returned by an extension method outside the core ACP method set.
Implementations§
Source§impl ClientResponse
impl ClientResponse
Sourcepub fn from_method_and_result(
method: &str,
result: Value,
) -> Result<Self, MethodDispatchError>
pub fn from_method_and_result( method: &str, result: Value, ) -> Result<Self, MethodDispatchError>
Parses a successful result using the originating request’s method.
Responses do not carry a method. The caller must retain it when sending the request and supply it here when the response arrives. This does not parse JSON-RPC error responses.
Use this instead of the enum’s untagged Deserialize
implementation, which can silently select an unrelated variant.
The result is deserialized unchanged, including null.
§Errors
Returns crate::MethodDispatchError::UnknownMethod for an
unsupported method, or crate::MethodDispatchError::InvalidPayload
for a malformed result.
Trait Implementations§
Source§impl Clone for ClientResponse
impl Clone for ClientResponse
Source§impl Debug for ClientResponse
impl Debug for ClientResponse
Source§impl<'de> Deserialize<'de> for ClientResponse
impl<'de> Deserialize<'de> for ClientResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ClientResponse
Available on crate feature schemars only.
impl JsonSchema for ClientResponse
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more