Skip to main content

bynk_model/
lib.rs

1//! `bynk-model`: the Bynk **system model**. It is the resolved description of
2//! what a Bynk program *is* at the level of declarations: service protocols,
3//! handler kinds and routes, type shapes, store fields, capability and
4//! attached-fn signatures, `given` references, actor seams and event
5//! subscriptions. Every tool that needs those facts reads them here, not from
6//! the AST.
7//!
8//! This is distinct from `bynk_check::project_model`, which models units and
9//! manifests, not declarations.
10//!
11//! The model sits above `bynk-check` (crate-hygiene B4, #3012). Its boundary
12//! half, `bynk_check::wire::WireModel`, stays in `bynk-check` because the
13//! checker's own boundary checks read it.
14//!
15//! Three modules, all re-exported at the root:
16//! - [`vocabulary`]: the model's items (until crate-hygiene B1, #2939, the
17//!   `bynk-ir` crate).
18//! - [`lower`]: the builder from a checked program to those items (until B1,
19//!   the `bynk-lower` crate).
20//! - [`entry`]: the entry handlers' signatures, described structurally for a
21//!   host such as the playground (until crate-hygiene B3, #2999,
22//!   `bynk_check::entry_signature`).
23//!
24//! The system-model ADR (crate-hygiene track ยง6, `design/archive/retired-tracks.md`)
25//! records the scope, the requirements every item is held to (M-1 one source
26//! per fact, M-2 total over certified programs, M-3 a reader outside the model,
27//! M-4 no new AST embedding) and what the model is not: not an expression IR,
28//! not the emit ABI, and not a second checker.
29
30// The README's `rust` examples are compiled (and, unless marked `no_run`, run)
31// as doctests, so they cannot rot (#1645). `cfg(doctest)` keeps this item out of
32// every build and out of the docs.rs front page, which the `//!` docs above own.
33#[cfg(doctest)]
34#[doc = include_str!("../README.md")]
35struct ReadmeDoctests;
36
37pub mod entry;
38pub mod lower;
39pub mod vocabulary;
40
41pub use entry::*;
42pub use lower::*;
43pub use vocabulary::*;