pub enum AnyArrival {
Subscribe {
message: AnyControlMessage,
request: AnyInboundRequest,
},
Other(AnyControlMessage),
}Expand description
What arrived from the peer, and whether this facade has a handle for it.
AnyConnection::recv_inbound returns one of these per message. Everything
is returned rather than filtered, because on drafts 07 through 16 the same
stream carries the peer’s requests and the answers to this side’s own —
a reader that quietly dropped what it was not looking for would swallow a
SUBSCRIBE_OK somebody was waiting on.
The variants differ in size for the reason AnyRequest’s do — one of them
carries a request stream and the other does not — and boxing to close the
gap would put an allocation on every message of every draft to flatter a
build no released configuration uses.
Variants§
Subscribe
The peer subscribed to a track this session publishes.
Answer it with AnyConnection::accept_subscribe. The message is the
SUBSCRIBE as it arrived, which is where the track it names lives — and,
on drafts 07 through 11, the Track Alias the subscriber chose.
Fields
message: AnyControlMessageThe SUBSCRIBE, decoded by the negotiated draft.
request: AnyInboundRequestThe handle to answer it through.
Other(AnyControlMessage)
Anything else the peer sent.
On drafts 07 through 16 that is any control message which is not a SUBSCRIBE: a response to one of this side’s own requests, or something sent unprompted such as MAX_REQUEST_ID. It has already been dispatched into the endpoint by the time it arrives here, so the session’s state is correct whether the caller reads it or not.
From draft-17 it is a request of a kind this facade has no entry point for, and its stream has already been reset — there is no handle in this variant to hold it open with, and a stream nobody holds is one the peer is owed an answer on forever. That asymmetry is real: on the older drafts this variant is passive, and on the newer ones producing it refuses something.