Skip to main content

Module architecture_facts

Module architecture_facts 

Source
Expand description

#3583: the project-wide facts behind bynk/architectureModel’s events and uses sections — who emits and who subscribes to each event, which capabilities each handler requires through given, and which suites stub a capability.

Until this module, event subscriptions were computed only to be validated (crate::project_model::phase_event_subscriptions) and a handler’s resolved given was read only for the sequence diagram. A client could approximate either by text search, which breaks on aliases and consumes qualification. These facts are resolved the way the checker resolves them:

  • an event’s owner is the context whose event table declares it, found locally first and then through the consuming context’s consumes, as crate::symbols::discover_event_subscribers does;
  • an emitter is a call the checker resolved to Events.emit (its own crate::checker::Callee, not the receiver’s spelling), with the event type the checker recorded on the call’s Callee (its type argument, written or inferred);
  • a handler’s given set is read after crate::project_model::normalize_service_defaults, so a service’s default_given is already part of each handler that declares none of its own; a use is marked inherited when its span lies outside the handler (it is written on the service header);
  • a capability reference resolves to its providing unit through the unit’s consumes aliases and flattened selections, as crate::project_model::handler_cross_caps does.

Spans are bare byte offsets against the project-relative file they are paired with. Nothing here carries source text.

Structs§

ArchitectureFacts
Everything bynk/architectureModel needs beyond a unit’s own declarations.
CallFact
EmitterFact
EventFact
FactInputs
The per-unit resolution tables the facts read.
FactSite
A project-relative file and a span within it.
HandlerUsesFact
MemberFact
One handler (or provider operation) of one unit.
StubFact
A stub of one capability in one suite (suite-level or in a case).
SubscriberFact
UseFact
One capability a handler requires through given.

Enums§

CallTarget
What a handler calls (model-diagrams slice 5).
DeliveryKind
How a subscription selects what it is delivered.
MemberKind
What declares the member that emits, subscribes or uses.

Functions§

architecture_facts
Compute the facts. Deterministic: units, events, members and uses are sorted, so the wire form does not churn between rounds.