Skip to main content

Module capability

Module capability 

Source
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:

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 classify needs.
Capabilities
What a draft can express, queryable before a run.
UnsupportedMatcherKey
A class rule keyed on something no unit it could claim ever carries.

Enums§

ActionKind
A capability, named independently of whether Action can express it.
Instead
What a run reports in place of the action event a Support::Unreachable cell can never produce.
MatcherKey
One value key a Matcher can be built on.
NotAttemptable
Why a Support::NotAttemptable cell cannot be reached.
Precondition
A runtime fact a Support::Conditional verdict 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 ReplacePayload rule: 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_attemptable already 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 StreamAction decisions.
keys_named 🔒
The keys a matcher names, in Matcher field order.
not_attemptable 🔒
Families 1-3 of Support::NotAttemptable, in the order classify documents: no constructor, then ReplaceObject’s single reading, then the return-type mismatch.
object_drop_elide 🔒
The object site’s DropElide rule, in guard order: facts about the stream before facts about the object.
object_framing_bypass 🔒
Why ObjectFramer cannot address objects on a stream of this shape, if it cannot.
object_replace_payload 🔒
The object site’s ReplacePayload rule: 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 StreamAction rather than Action.
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 field can ever claim a unit arriving as kind, on draft, in this build.