#[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 connection handles the responses automatically.
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<ClientResponse, MethodDispatchError>
pub fn from_method_and_result( method: &str, result: Value, ) -> Result<ClientResponse, 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§fn clone(&self) -> ClientResponse
fn clone(&self) -> ClientResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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<ClientResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ClientResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonRpcResponse for ClientResponse
impl JsonRpcResponse for ClientResponse
Source§impl JsonSchema for ClientResponse
impl JsonSchema for ClientResponse
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