pub enum ProtocolSide {
A2a,
Mcp,
}Expand description
The two sides of a cross-protocol translation, recorded for the operator.
Variants§
A2a
A2A v1.0. The wire surface is JSON-RPC 2.0; the method names are
SendMessage, GetTask, etc.
Mcp
MCP at any revision the bridge negotiated.
Implementations§
Source§impl ProtocolSide
impl ProtocolSide
Sourcepub fn wire_method(self, ir_method: &str) -> Option<&'static str>
pub fn wire_method(self, ir_method: &str) -> Option<&'static str>
The wire method name the bridge will hand to the peer on this side.
Returns None when the bridge cannot express the method on this
side at all — the caller refuses the call rather than sending a
method name the peer will reject as -32601.
The first arm is the row an A2A client hits: it called
SendMessage, the bridge lifts that to the IR name SendMessage,
and the codec now needs the wire name the upstream peer
(the MCP agent) reads, which is tools/call. The second arm
is the mirror case: an MCP client called tools/call, the
bridge lifted to the IR name tools/call, and the upstream
(an A2A agent) reads SendMessage.
§Examples
use protocol_droid::application::bridge::ProtocolSide;
assert_eq!(
ProtocolSide::A2a.wire_method("SendMessage"),
Some("tools/call")
);
assert_eq!(
ProtocolSide::Mcp.wire_method("tools/call"),
Some("SendMessage")
);