Expand description
What is representable, per draft, per site, per stream — and why not.
One function answers that question — classify — and it has exactly
two callers: Capabilities::supports / Capabilities::supports_on,
which publish the table a caller reads before a run, and the
engine’s executor, which decides what actually happens during one. That
is the whole of the design: the table and the engine are the same code,
so the table cannot become a documented lie about the engine.
tests/action_matrix.rs asserts it against observed behaviour on all
fourteen drafts.
§Where each Refusal comes from
Not every refusal is a (site, kind) fact, so not every refusal is
classify’s to produce:
- Classified here, from
(site, kind)plusCapCtx:Refusal::WrongSite,Refusal::ControlStreamResetIllegal,Refusal::LengthChanged,Refusal::WouldRedefineSubgroupId,Refusal::WouldDestroyStatusObject,Refusal::ReservedHeaderModeandRefusal::PayloadNotDelimited. - Produced by the executor, because they depend on the action’s payload
or on session state rather than on the pair:
Refusal::WrongComposition(what aDelay/Holdwrapped),Refusal::ErrorCodeOutOfRange(the numeric code) andRefusal::SessionAlreadyClosing(a close already in flight). They are reachable, and the sweep observes them; they are simply not decidable from a kind. - Table-only:
Refusal::StreamNotFramedandRefusal::ControlFrameNotDecodable. Both appear only insideSupport::NotAttemptableandSupport::Unreachable, where nothing is ever attempted, so neither is ever emitted as aProxyEvent::ActionRefused.
tests/action_matrix.rs::every_declared_refusal_is_reachable_or_declared_table_only
asserts that split per variant, in both directions.
§The table answers for a build, not only for a draft
DraftVersion carries all fourteen variants under every feature set,
so Capabilities::for_draft answers for drafts this binary cannot
speak. A reduced-draft build — --no-default-features --features draft07, a shipped configuration and one of CI’s fourteen rows — cannot
frame a byte of the twelve drafts it left out, and
ProxySessionConfig::default().draft is Draft14 with nothing
validating it against the compiled set. draft_is_compiled is
therefore a fact classify reads, exactly like the draft number, and
the object and control sites on an uncompiled draft are
Support::Unreachable rather than Support::Yes. The two fail in
different decoders and report different events, so they are two reads
of the same fact rather than one; see Instead, which is where each
names what a run emits in its place. In the default all-drafts build
every row of the table is unchanged.
Structs§
- CapCtx
- The facts
classifyneeds. - Capabilities
- What a draft can express, queryable before a run.
- Unsupported
Matcher Key - A class rule keyed on something no unit it could claim ever carries.
Enums§
- Action
Kind - A capability, named independently of whether
Actioncan express it. - Instead
- What a run reports in place of the action event a
Support::Unreachablecell can never produce. - Matcher
Key - One value key a
Matchercan be built on. - NotAttemptable
- Why a
Support::NotAttemptablecell cannot be reached. - Precondition
- A runtime fact a
Support::Conditionalverdict depends on. - Refusal
- Why an action could not be executed.
- Site
- Where a decision was taken.
- Support
- Whether a capability is available.
Constants§
- ANY_
KIND 🔒 - Every kind a rule that names none of them may claim.
- DEFAULT_
DRAFT - The draft a session configuration takes when the caller names none.
- DEFAULT_
DRAFT_ 🔒ORDER - Every draft this build could take as a default, in the order it would take them.
- RESERVED_
SUBGROUP_ 🔒ID_ MODE - The fourth value of the two-bit subgroup-ID mode, which no draft assigns.
Functions§
- classify
- The single source of truth for what is executable.
- classify_
control 🔒 - The control site, which is honoured on every draft.
- classify_
datagram 🔒 - The datagram site.
- classify_
object 🔒 - The object site, on a stream the framer can address: subgroup streams on every compiled draft, and fetch streams on the drafts whose objects this codec can read.
- classify_
stream_ 🔒decision - The two stream-decision sites.
- classify_
stream_ 🔒end - The stream-end site’s two columns: data streams and control streams.
- datagram_
replace_ 🔒payload - The datagram site’s
ReplacePayloadrule: the payload’s start offset must be derivable, or there is nowhere to splice the replacement in. - default_
draft 🔒 - draft_
is_ compiled - Whether this build compiled a codec for
draft. - fetch_
group_ 🔒order_ is_ needed - Whether a fetch stream on this draft can be read only by an endpoint that knows the Group Order the fetch was asked for.
- filtered_
earlier 🔒 - The answer
not_attemptablealready gave, restated. - has_
implicit_ 🔒subgroup_ id_ mode - Whether this draft defines a subgroup ID is the first object’s ID stream type.
- is_
stream_ 🔒decision - Whether this kind is one of the four
StreamActiondecisions. - keys_
named 🔒 - The keys a matcher names, in
Matcherfield order. - not_
attemptable 🔒 - Families 1-3 of
Support::NotAttemptable, in the orderclassifydocuments: no constructor, thenReplaceObject’s single reading, then the return-type mismatch. - object_
drop_ 🔒elide - The object site’s
DropEliderule, in guard order: facts about the stream before facts about the object. - object_
framing_ 🔒bypass - Why
ObjectFramercannot address objects on a stream of this shape, if it cannot. - object_
replace_ 🔒payload - The object site’s
ReplacePayloadrule: the replacement must be the declared payload length, and the object must not carry a status. - payload_
not_ 🔒delimited_ detail - Which of
Precondition::DatagramPayloadDelimited’s three cases failed. - site_
returns_ 🔒stream_ action - Whether this site’s hook method returns
StreamActionrather thanAction. - subgroup_
id_ 🔒mode_ must_ be_ consulted - Whether a header’s reserved subgroup-ID mode has to be told apart from mode 1 before an object behind it can be judged. Drafts 15-20.
- supports_
matcher - Whether a rule keyed on
fieldcan ever claim a unit arriving askind, ondraft, in this build.