liminal_sdk/remote/handles/negotiated.rs
1#![cfg(feature = "std")]
2//! The protocol version a remote channel handle's connection negotiated.
3//!
4//! A producer reads it beside a publish result: a [`DeliveryAck`] with no
5//! durable position says only that the acknowledgement carried none, and the
6//! negotiated version is how the caller learns which protocol was selected.
7//!
8//! [`DeliveryAck`]: crate::DeliveryAck
9
10use liminal::protocol::ProtocolVersion;
11
12use super::RemoteChannelHandle;
13
14impl RemoteChannelHandle {
15 /// The protocol version the server selected in the current connection's
16 /// `ConnectAck`, or `None` before a handshake has completed (including on
17 /// the in-process protocol transport, which never opens a connection).
18 #[must_use]
19 pub fn negotiated_version(&self) -> Option<ProtocolVersion> {
20 self.transport.negotiated_version()
21 }
22}