pub struct NegotiatedSession {
pub version: ProtocolVersion,
pub profile: FeatureProfile,
pub client_caps: CapabilitySet,
pub server_caps: CapabilitySet,
pub transport: TransportKind,
pub client_info: Option<PeerInfo>,
pub server_info: Option<PeerInfo>,
pub is_stateless: bool,
}Expand description
A session that has agreed on a version and a feature profile.
Deliberately not a connection: for 2026-07-28 this is per-request and
nothing is retained, which is why Self::is_stateless is part of the
value rather than a property of whatever holds it.
Fields§
§version: ProtocolVersionThe version both sides speak.
profile: FeatureProfileWhat this session may do.
client_caps: CapabilitySetWhat the client advertised.
server_caps: CapabilitySetWhat the server advertised.
transport: TransportKindThe transport the session runs over.
client_info: Option<PeerInfo>The client implementation, when it identified itself.
server_info: Option<PeerInfo>The server implementation, when it identified itself.
is_stateless: boolWhether this profile is recomputed per request with nothing retained.
Implementations§
Source§impl NegotiatedSession
impl NegotiatedSession
Sourcepub fn new(
version: ProtocolVersion,
transport: TransportKind,
client_caps: CapabilitySet,
server_caps: CapabilitySet,
) -> Self
pub fn new( version: ProtocolVersion, transport: TransportKind, client_caps: CapabilitySet, server_caps: CapabilitySet, ) -> Self
Builds a session from an agreed version and a pair of capability sets.
Sourcepub fn with_client_info(self, info: PeerInfo) -> Self
pub fn with_client_info(self, info: PeerInfo) -> Self
Attaches the client’s identity.
Sourcepub fn with_server_info(self, info: PeerInfo) -> Self
pub fn with_server_info(self, info: PeerInfo) -> Self
Attaches the server’s identity.
Sourcepub const fn negotiation(&self) -> Negotiation
pub const fn negotiation(&self) -> Negotiation
The four inputs profile was resolved from.
Client::from_session
reads the profile off a session and needs nothing else, so this is here
for the callers that genuinely hold a bare Negotiation and want to
make one. new already resolved from exactly these four
fields, so re-resolving the value this returns reproduces profile
rather than recomputing anything new — which is why it is a convenience
and not the way to build a client.