Public declaration syntax from forge-rs/crates/forge-comm/src/protocol.rs Original source SHA-256: f8f3752d04f7740c0270fe78631bbb18270e23bf4630bc2e08e6aa651f9680c4 Function bodies and constant values are omitted. This is not the complete implementation. Source line 56 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct ProtocolOffer { /// The protocol identifier (e.g., `"anvil.task"`). /// /// This identifies the protocol family without a version suffix. pub protocol: String, /// The versions the offering agent supports, ordered by preference. /// /// Version strings follow the pattern `"v1"`, `"v2"`, etc. The first /// version in the list is the most preferred by the offering agent. pub versions: Vec, /// Optional extensions the offering agent supports. /// /// Extensions are additional capabilities within the protocol, such as /// `"streaming"`, `"compression"`, or `"batching"`. Both agents must /// agree on extensions for them to be active. pub extensions: Vec } Source line 99 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct ProtocolAccept { /// The agreed-upon protocol identifier. pub protocol: String, /// The agreed-upon version string. pub version: String, /// The extensions active for this protocol session. /// /// This is the full set of extensions from the offer, carried through /// to the acceptance. In a full implementation, this would be intersected /// with the accepting agent's supported extensions. pub extensions: Vec } Source line 154 pub fn negotiate_protocol( offered: &ProtocolOffer, supported_versions: &[&str], ) -> Result;