#[non_exhaustive]pub struct FrameCtx<'a> {
pub session_id: SessionId,
pub side: ProxySide,
pub draft: DraftVersion,
pub stream_id: Option<u64>,
pub arrived_at: Instant,
pub caps: &'a Capabilities,
}Expand description
Context for a control message or datagram decision.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: SessionIdThe session identifier.
side: ProxySideThe side the unit arrived on.
draft: DraftVersionThe draft this unit was parsed under.
A session’s draft is not necessarily the one it was configured with.
The ALPN names a draft outright from draft-15 on, and such a session
is settled before it dials, so this never moves. Drafts 07 to 14
share the one ALPN moq-00: a session in that cohort starts on the
draft its configuration named and the control stream refines it from
the first SETUP it can read — CLIENT_SETUP’s highest offered version,
which SERVER_SETUP’s selected version then outranks, because the
second is what the peers agreed and the first is only what one of
them proposed.
Both sites this context is built for see the refined answer rather
than the starting draft, by two different mechanisms.
ProxyHook::on_datagram’s forwarding task waits for the control
stream to answer before it reads its first datagram.
ProxyHook::on_control_message needs no wait: a session that
declared Interest::CONTROL
withholds the control stream’s bytes until the leading SETUP has been
peeked at, so even the frame that named the draft is reported under
it.
Two cases end the wait with the starting draft instead, and both are sessions no draft describes: a peer that sends no SETUP at all, and a peer whose first control message is something else. A SETUP arriving after either still refines what comes after it.
stream_id: Option<u64>The stream this frame belongs to. None for datagrams.
arrived_at: InstantWhen the proxy produced this unit for decision.
caps: &'a CapabilitiesWhat is executable on this draft at this site.