Expand description
Workspace: where the programs a program places, and the files its
steps read, come from — the one thing a run reads that is not given to
it as inputs or state, and not built by its steps — and Files, a
workspace of files read from a FileStore.
A program never knows where it is. The runner running it does
(Location): the file it is in, and the files placing it. A make
reads a file through its reader (crate::reader::Reader::read_file,
crate::reader::Reader::program), which records the file’s revision
(Workspace::revision): its node is made again exactly when the file
changed.
Placing a part runs the program of another file, which may place parts of its own. So the files of a workspace form a graph, and it has to be acyclic: a file that places itself, directly or through others, would never finish building. The runner refuses such a placement with an error naming the cycle.
Files name each other by /-separated paths relative to the file doing
the naming — bolt.geop, ../parts/bolt.geop — so a folder of files
can be moved as a whole. resolve turns such a reference into the
path a workspace knows the file by, relative goes back.
A file of a library every workspace shares — the standard parts an
application offers — is named by a scheme instead: std:hex_nut.geop
(see is_shared). Such a name means the same file from anywhere, so
it is never relative.
Structs§
- Files
- A set of files, whose programs are written in the operations of
registry: theWorkspaceits programs are run with, reading the programs they place and the files they import from it. A program read is checked against the operations (seeProgram::validate). - Location
- Where the program a runner runs is: the file it is in, and the files placing it, outermost first — which it must not place again, or the files would place themselves. The runner’s to know, never the program’s.
Constants§
- BYTES_
PREFIX - What the content of a file of bytes that are not text starts with: a
data:URL of them, in base64 (seecontent).
Traits§
- File
Store - Where
Filesreads files from. - File
Store Mut FileStoreFilescan change (Files::write).- Workspace
- Programs and other files, by path.
Functions§
- base64
bytesas base64 text (RFC 4648, padded).- bytes
- The bytes of a file whose content is
content(seecontent). - content
- The content of a file of
bytes, as a workspace holds it: a file holds text, so the text they spell where they are UTF-8 throughout, and otherwise — a binary STL, a STEP file with a Latin-1 name in it — adata:URL of them in base64. A front end reading a file a user chose holds it the same way, so files travel as text everywhere and only what reads bytes (bytes) or text (text) decodes them. - from_
base64 - The bytes of the base64 text
text(RFC 4648, padded or not). - is_
program - Whether the file
pathis a program, which a part can be placed from: a.geopfile. - is_
shared - Whether
referencenames a file of a library every workspace shares, by a scheme of two letters or more and:—std:hex_nut.geop. It names the same file from anywhere: it is never relative. (A single letter before the:is a drive,C:/parts/bolt.geop.) - relative
- How the file
fromnames the fileto, both paths asresolvegives them: relative to the folderfromis in — a shared library’s file by its own name (seeis_shared). - resolve
- The path of the file
referencenames, from the filefrom: relative to the folderfromis in, unless it starts with/or is a shared library’s (seeis_shared)..and..are taken out where they can be, and\read as/. - text
- The text of a file whose content is
content(seecontent): its bytes read as UTF-8, what is not replaced.