pub struct Program {
pub name: String,
pub types: BTreeMap<Arc<str>, TyDecl>,
pub traits: Vec<TraitSig>,
pub impls: Vec<ImplSig>,
pub own_types: Vec<Arc<str>>,
pub imports: Vec<String>,
pub defs: BTreeMap<Arc<str>, Def>,
pub def_order: Vec<Arc<str>>,
pub signals: Vec<SignalDecl>,
pub tests: Vec<TestDef>,
pub docs: BTreeMap<Arc<str>, Arc<str>>,
pub identity: Option<IdentityDecl>,
}Expand description
A checked module: everything the placement checker, the splitter and the runtime need.
Fields§
§name: String§types: BTreeMap<Arc<str>, TyDecl>§traits: Vec<TraitSig>The trait declarations this module owns, in declaration order.
impls: Vec<ImplSig>The impl headers this module owns, in declaration order. Both cross a .becki: a call in
another module cannot resolve item.pence() without knowing the trait and that the impl
exists.
own_types: Vec<Arc<str>>The types this module declares, in declaration order. An imported type is usable here and published by the module that owns it, never by this one (§3.6).
imports: Vec<String>The interfaces this module was checked against.
defs: BTreeMap<Arc<str>, Def>§def_order: Vec<Arc<str>>Source order, so diagnostics and beck explain are stable.
signals: Vec<SignalDecl>§tests: Vec<TestDef>§docs: BTreeMap<Arc<str>, Arc<str>>The ## doc comment attached to each declaration, keyed by the name it documents:
todos for a definition or signal, Todo for a type, Todo.text for a model field and
Event.Toggled for a union variant (beck_syntax::doc).
A side table rather than a field on Def, because documentation is not something the
checker, the solver or the runtime may read: nothing downstream of here may behave
differently because a definition is documented.
identity: Option<IdentityDecl>identity = external(issuer="…") — who authenticates this program’s clients (D6).
On the Program rather than in the runtime’s configuration because it is a fact about the
program that §6.5’s derivation needs: the issuer is a peer, and an egress rule is
derived from the peers a program names. None is the default provider, which believes
whatever a client says it is.