Skip to content

Function envelope::check_version

zaun_community_protocol::envelope::check_version · Function

pub fn check_version(v: u16, negotiated: Option<u16>) -> Result<(), ErrorBody>

Checks an inbound envelope’s v against the connection’s negotiated version.

After negotiation v MUST equal it; otherwise UNSUPPORTED_VERSION with this crate’s range (VersionRange::CURRENT). Before negotiation any v passes: only session.hello is answered then (anything else gets HELLO_REQUIRED), and its versions body decides.

UNSUPPORTED_VERSION when v differs from the negotiated version.

Full rustdoc page