liminal-sdk 0.16.0

Application-facing SDK traits for liminal messaging clients
Documentation
#![cfg(feature = "std")]
//! The protocol version a remote channel handle's connection negotiated.
//!
//! A producer reads it beside a publish result: a [`DeliveryAck`] with no
//! durable position says only that the acknowledgement carried none, and the
//! negotiated version is how the caller learns which protocol was selected.
//!
//! [`DeliveryAck`]: crate::DeliveryAck

use liminal::protocol::ProtocolVersion;

use super::RemoteChannelHandle;

impl RemoteChannelHandle {
    /// The protocol version the server selected in the current connection's
    /// `ConnectAck`, or `None` before a handshake has completed (including on
    /// the in-process protocol transport, which never opens a connection).
    #[must_use]
    pub fn negotiated_version(&self) -> Option<ProtocolVersion> {
        self.transport.negotiated_version()
    }
}