Skip to main content

Module placed

Module placed 

Source
Expand description

Placed parts: the part another program builds, placed in a part as a node of its own (placed), whose value is the built part (PlacedPart), made by build_placed.

A placed part is built from exactly its program, its inputs and the slice of the placing part’s state under its name — the state /bolt:b.pose of the part is the state b.pose of the part placed as bolt (key_behind). Equal builds are shared through the runner’s build cache: a thousand screws of one size are one build. Where the part goes is no concern of the build: the pose that places it is the placing part’s state, read by whatever draws or mates it.

An element of a placed part is named by the instance’s path before its target’s name — /bolt:model, or /asm/bolt:model for a part placed in a placed part, and /:model for one of the part itself (Located) — and read through the placing part’s reader (crate::reader::Reader::retrieve_placed, crate::reader::Reader::placed_part), which records it as read inside the placed part: a node reading the second link of an arm is made again when that link changes, not when anything in the arm does.

A part placed reads the part placing it in context, while it is built there, through the path OUTSIDE: /../bracket:model is the model of the part placed as bracket beside it — placed before it, so that no two parts read each other — and /..:model the placing part’s own (see crate::reader::Reader::outside). What it read so is read by the placing part for it, so a change there builds it again, and a build of it is shared only where what it read there reads the same.

Structs§

InInstance
An element of a part or of a part placed in it, as it is in its own part (Reader::retrieve_placed): where that part is placed, the step that placed it says.
Located
A name behind the path of the instance it is in: a target of a part placed in the part — however deep — or of the part itself, its path empty. Spelled /asm/bolt:model, and /:model for the part itself (Located::parse, its Display), and saved and sent to a front end so.
PlacedArgs
What a part is placed from: the program file, as the placing program names it, what its parameters are set to, and the steps run after its own — none, for the part as its file builds it: a part derived from it, mirrored, say, otherwise.
PlacedPart
A placed part, as built: shared by every instance built alike — and where its program is, which an editor edits it in.

Constants§

INSTANCE_SEPARATOR
What separates the names of a path of instances, and begins a located name: /asm/bolt:model.
OUTSIDE
The name of the part a part is placed in, in a path of instances: the part placing it, read in context — /../bracket:model.
TARGET_SEPARATOR
What separates a located name’s instance path from the name in that instance: /asm/bolt:model. A name is split at the first one after the path, so the name itself may hold more: /asm:placed:bolt.

Functions§

build_derived
The part the program args places builds on its own — with its own state, placed nowhere: what a step deriving a part from another reads the bodies of. Shared with every build alike, a placed one’s too. Records the file and every file the part read.
build_placed
The make of a placed part (see place): the program in the file args.file names, run with args.inputs and the state the placing part gives under the instance’s name, the program’s own where it gives none. Taken from the runner’s build cache where an equal build is there; else built from the part the instance had before, if it had one, so that only what reads what changed is made again — placed in the part reader reads, which it reads in context. Records the file and every state and file the part placed read, and what it read in context.
instance_path
The path of the instance name of the instance at outer: asm/bolt — name itself, for none. A path is held without the leading INSTANCE_SEPARATOR its located names are spelled with. A name through the part outer is placed in (OUTSIDE) goes up out of it: ../bracket of asm/p is asm/bracket.
key_behind
The key key of the part placed as instance — its own, b.pose, or one of a part placed in it, /bolt:b.pose — as a key of the part it is placed in: /asm:b.pose, /asm/bolt:b.pose (see Located::key).
key_inside
The key of the part placed as instance that key, a key of the part it is placed in, is, if it is one of that part: key_behind undone.
outermost_instance
The outermost instance a key of a part’s own table is of, and the key as that instance’s part names it: none for a key of the part’s own.
place
Places the part the program in args.file builds as instance, its parameters set to args.inputs (build_placed). Fails if a step of the part placed fails — after placing it as far as it builds.
placed
The target of the part placed as instance.
split_instance_path
The path of the instance the instance at path is placed in, and its name there: ("asm", "bolt") for asm/bolt, an empty path for an instance of the part itself — instance_path undone.