pub struct Placed {
pub program: Program,
pub roles: Roles,
pub wire_id: String,
pub placement: Solution,
pub graph: Graph,
pub render: Decision,
pub kind: Kind,
}Expand description
A program with its signal graph sliced into the roles the runtime drives.
Fields§
§program: Program§roles: Roles§wire_id: StringA content-derived id for the command channel, per §4.3: “a stable, content-derived
operation id (sha256(module, name, signature)[..16]) — not a URL a human maintains, and
stable across refactors that don’t change the signature.”
placement: SolutionHow stage 7 placed the program, kept so that beck explain place prints the derivation
rather than re-deriving it from a second, drifting copy.
graph: GraphThe signal graph itself, kept so that beck explain flow, the incremental analysis and any
later view engine read what the slicer read rather than re-deriving it.
render: DecisionWhere this program’s component renders, and what follows (crate::render). Decided here
because the fact it turns on — whether the sliced view reads the session — is this module’s
to know.
kind: KindWhether this is an application or a library — a module with no merge point, whose
Placed::roles are placeholders rather than a slice of anything.
A library used to have no Placed at all, which meant it had no way to run its own tests
(docs/22 §22.6, docs/25 §25.6 item 1): every SICP exercise is a library, and so is
every domain module a real project would most want unit tests for. It has one now — but a
placeholder role is a lie a caller must not be able to tell by accident, so the flag is on
the struct and Placed::is_application is what the paths that drive a program ask.
Implementations§
Source§impl Placed
impl Placed
pub fn is_application(&self) -> bool
Sourcepub fn library(program: Program, graph: Graph, wire_id: String) -> Placed
pub fn library(program: Program, graph: Graph, wire_id: String) -> Placed
A module with no merge point, wrapped so that the parts of the toolchain that do not need one can still reach it.
The four roles are placeholders and they are chosen to be inert rather than plausible: the
fold returns its accumulator unchanged, validate refuses everything, the view renders
nothing and the initial state is unit. Nothing should ever call them — Kind::Library is
the flag that says so, and beck test refuses a given, a when or a page expectation
against a library by name rather than running one of these and reporting a confusing pass.