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: ... }
§Fase 41.b — 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 §41.a 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
§40.t snapshot); absent or reconnect: none → false.
legal_basis: Option<String>Optional legal_basis: annotation (enterprise audit/shield gate).
loc: Loc§leading_trivia: Vec<Trivia>Fase 14.b — leading comment trivia.
trailing_trivia: Vec<Trivia>Fase 14.b — trailing comment trivia.