pub fn envelope_to_expr(envelope: &McpEnvelope) -> ExprExpand description
Project an McpEnvelope into its canonical Expr map, with the mcp
version field and the variant-specific fields.
ยงExamples
use sim_codec_mcp::{McpEnvelope, McpRequest, envelope_to_expr};
let envelope = McpEnvelope::Request(McpRequest::default());
let expr = envelope_to_expr(&envelope);
// Round-trips back to the same typed envelope.
assert_eq!(sim_codec_mcp::expr_to_envelope(&expr).unwrap(), envelope);