Skip to main content

server_capabilities_json

Function server_capabilities_json 

Source
pub fn server_capabilities_json(profile: FeatureProfile) -> Value
Expand description

Renders a profile’s server capabilities as a ServerCapabilities object.

Reads FeatureProfile::advertised_by_server rather than being handed a set, so there is no way to reach this function with a capability set that did not come from the profile. That is the drift this exists to prevent: a caller that passed in its own set would be free to advertise a flag the gates behind it would refuse, and the peer would have been told otherwise at connect time.

A bridge passes the intersection here, which is the whole point of computing one: the object a client reads is the set of things the bridge can actually do behind it.

A capability in the derived set with no row in SERVER_CAPABILITY_WIRE is not emitted. Two are in that position and neither is reachable from a server: the client-side ones, which advertised_by_server cannot produce because their feature rows are Side::Client, and Capability::Extensions, which only 2026-07-28 defines — a revision a caller has already refused before getting here, because that revision has no InitializeResult to put it in.