pub enum Event<'a> {
Settings(SettingsFrame<'a>),
SettingsAck(Settings),
Headers {
stream: u32,
headers: Vec<Header>,
end_stream: bool,
kind: HeadersKind,
},
Data {
stream: u32,
bytes: &'a [u8],
end_stream: bool,
},
PushPromise {
stream: u32,
promised: u32,
headers: Vec<Header>,
},
Reset {
stream: u32,
code: u32,
},
Unprocessed {
stream: u32,
},
Goaway {
last_stream: u32,
code: u32,
debug: Option<&'a [u8]>,
},
Ping {
ack: bool,
data: [u8; 8],
},
WindowUpdate {
stream: u32,
},
}Variants§
Settings(SettingsFrame<'a>)
The peer’s SETTINGS, already applied and acknowledged.
SettingsAck(Settings)
The peer acknowledged the oldest SETTINGS frame this endpoint still had
outstanding; its parameters are returned here and are now in force.
Acknowledgements arrive in the order the frames were sent (RFC 9113
section 6.5.3), and the first is always for the frame the constructor
queued, so a host that timestamps construction and each
Connection::settings call can pair them in FIFO order to measure a
round trip. No clock is read here.
Headers
Data
PushPromise
The server promised a response to the request headers (RFC 9113
section 8.4), on stream, a stream this endpoint opened. promised is
the server-initiated stream that will carry the response: its HEADERS
and DATA arrive as ordinary events, and Connection::reset declines
it. Only a client receives this, and only while it has not disabled push
with ENABLE_PUSH = 0.
Reset
The stream is over. It may name a stream the host never saw opened: a
stream past the concurrent-stream limit is refused with
RST_STREAM(REFUSED_STREAM) before any Event::Headers for it is
produced (RFC 9113 section 5.1.2 requires a stream error there, and
Node answers the same way — measured).
Unprocessed
The peer opened a stream after a graceful GOAWAY, above the last stream id that GOAWAY named, and nothing has been sent for it. RFC 9113 section 6.8 makes such a stream simply “not processed” — the peer is expected to retry it on a new connection — and Node emits no frame at all here (measured against Node 26.5.1 with a raw peer: no RST_STREAM, no GOAWAY, the session stays alive and the request never reaches the application).
The header block was decoded and discarded, because HPACK is connection
state. The connection deliberately does not answer for the host: a frame
it emitted could not be un-emitted, so a host that must match Node would
have no way back. A host that wants to answer may call
Connection::reset.