pub struct SocketDefinition {
pub name: String,
pub protocol: String,
pub backpressure_credit: Option<i64>,
pub reconnect: bool,
pub legal_basis: Option<String>,
pub loc: Loc,
pub leading_trivia: Vec<Trivia>,
pub trailing_trivia: Vec<Trivia>,
}Expand description
socket Name { protocol: SessionRef, backpressure: credit(n), reconnect: cognitive_state, legal_basis: ... }
v2.3.0 — the typed WebSocket transport (paper_websocket_cognitive_primitive.md).
socket is NOT the protocol — the protocol is a session it references by
name (protocol and transport kept separate but composable). The type checker
resolves protocol to a declared session (whose two roles are already
duality-checked via the v2.3.0 algebra), so the dialogue carried over the WS
connection is conformant + deadlock-free by construction.
Fields§
§name: String§protocol: StringThe referenced session declaration’s name — the protocol.
backpressure_credit: Option<i64>The credit window of the typed-resource backpressure (credit(n));
None if unspecified. A 0 credit is rejected by the type checker.
reconnect: boolreconnect: cognitive_state → true (resume mid-dialogue via a sealed
v2.0.0 snapshot); absent or reconnect: none → false.
legal_basis: Option<String>Optional legal_basis: annotation (enterprise audit/shield gate).
loc: Loc§leading_trivia: Vec<Trivia>v1.5.2 — leading comment trivia.
trailing_trivia: Vec<Trivia>v1.5.2 — trailing comment trivia.