Skip to main content

Module initialize

Module initialize 

Source
Expand description

The initialize exchange, as both a server and a bridge read it.

This is shared because two callers genuinely need it and neither owns it. A server answers a client’s handshake. A bridge is the server on its downstream leg, so it reads the same request and answers the same way — with the difference that the capabilities it advertises are the intersection of what the client asked for and what the upstream server agreed to, rather than whatever the local process can do.

Putting the parsing here rather than in either caller is what keeps that difference from becoming a second reading of the wire format. The capability tables in crate::domain map a Rust name to a JSON path, and two copies of that mapping would be two definitions of what a client is allowed to say.

§What is not here

Choosing a revision is not in this module. Reading an offer is a wire format question; agreeing on a version is a negotiation question, and the two answer to different inputs — see agree for the server and the bridge’s downstream handler for the bridge.

Structs§

Offer
What a client said in its initialize.

Enums§

InitializeError
Why an initialize could not be read.

Functions§

client_capabilities
Reads a ClientCapabilities object as a CapabilitySet.
read_offer
Reads an initialize request body.
server_capabilities_json
Renders a profile’s server capabilities as a ServerCapabilities object.