#[non_exhaustive]pub enum MessageMcpResponse {
Result {
result: Value,
meta: Option<Map<String, Value>>,
},
Error {
error: McpError,
meta: Option<Map<String, Value>>,
},
}Available on crate feature
unstable_mcp_over_acp only.Expand description
UNSTABLE
The successful outer ACP mcp/message response carries exactly one
inner MCP outcome: an opaque result (including JSON null), or an MCP error.
Outer ACP errors are reserved for binding and runtime failures.
Both branches require their carrier key. An error must be a non-null object.
Unknown outer fields are ignored; inner result and error fields are preserved.
Carrier _meta is optional; null or invalid values are treated as absent.
Senders must include exactly one outcome; receivers prefer result if both are present.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl MessageMcpResponse
impl MessageMcpResponse
Sourcepub fn success(result: Value) -> MessageMcpResponse
pub fn success(result: Value) -> MessageMcpResponse
Wrap any JSON result without interpreting its MCP result type.
Sourcepub fn error(error: McpError) -> MessageMcpResponse
pub fn error(error: McpError) -> MessageMcpResponse
Wrap an inner MCP error in a successful outer ACP response.
Sourcepub fn meta(
self,
meta: impl IntoOption<Map<String, Value>>,
) -> MessageMcpResponse
pub fn meta( self, meta: impl IntoOption<Map<String, Value>>, ) -> MessageMcpResponse
Attach optional carrier-level ACP metadata.
Trait Implementations§
Source§impl Clone for MessageMcpResponse
impl Clone for MessageMcpResponse
Source§fn clone(&self) -> MessageMcpResponse
fn clone(&self) -> MessageMcpResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageMcpResponse
impl Debug for MessageMcpResponse
Source§impl<'de> Deserialize<'de> for MessageMcpResponse
impl<'de> Deserialize<'de> for MessageMcpResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageMcpResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageMcpResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonRpcResponse for MessageMcpResponse
impl JsonRpcResponse for MessageMcpResponse
Source§impl JsonSchema for MessageMcpResponse
impl JsonSchema for MessageMcpResponse
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for MessageMcpResponse
impl PartialEq for MessageMcpResponse
Source§impl Serialize for MessageMcpResponse
impl Serialize for MessageMcpResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for MessageMcpResponse
Auto Trait Implementations§
impl Freeze for MessageMcpResponse
impl RefUnwindSafe for MessageMcpResponse
impl Send for MessageMcpResponse
impl Sync for MessageMcpResponse
impl Unpin for MessageMcpResponse
impl UnsafeUnpin for MessageMcpResponse
impl UnwindSafe for MessageMcpResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.