pub struct Runner {
pub registry: Rc<OperationRegistry>,
pub workspace: Option<Rc<dyn Workspace>>,
pub location: Location,
/* private fields */
}Expand description
Runs programs on parts, with the operations of registry, reading
what they place and import from workspace as the program in the file
of location names it: location.within is the stack of files being
built, which a file must not place again.
Fields§
§registry: Rc<OperationRegistry>§workspace: Option<Rc<dyn Workspace>>§location: LocationImplementations§
Source§impl Runner
impl Runner
Sourcepub fn new(registry: OperationRegistry) -> Self
pub fn new(registry: OperationRegistry) -> Self
A runner of the operations of registry, of programs that read and
place nothing.
Sourcepub fn of(
registry: Rc<OperationRegistry>,
workspace: Option<Rc<dyn Workspace>>,
location: Location,
) -> Self
pub fn of( registry: Rc<OperationRegistry>, workspace: Option<Rc<dyn Workspace>>, location: Location, ) -> Self
A runner of the operations of registry, of the program in the file
of location of workspace, with a build cache of its own.
Sourcepub fn run(
&self,
part: &mut Part,
program: &Program,
upto: Option<&str>,
) -> RunOutput
pub fn run( &self, part: &mut Part, program: &Program, upto: Option<&str>, ) -> RunOutput
Runs the steps of program before the step upto — all of them, if
None — on part, with the program’s state and no inputs. The
nodes of the steps after upto are kept for when they run again;
those of steps no longer in the program are dropped.
Sourcepub fn run_with(
&self,
part: &mut Part,
program: &Program,
inputs: &Settings,
upto: Option<&str>,
) -> RunOutput
pub fn run_with( &self, part: &mut Part, program: &Program, inputs: &Settings, upto: Option<&str>, ) -> RunOutput
Runner::run, its parameters set to inputs.
Sourcepub fn run_step(
&self,
part: &mut Part,
step: &str,
body: impl FnOnce(&mut StepContext<'_>) -> GeopResult<()>,
) -> GeopResult<()>
pub fn run_step( &self, part: &mut Part, step: &str, body: impl FnOnce(&mut StepContext<'_>) -> GeopResult<()>, ) -> GeopResult<()>
Runs one step by hand, as the step step after those part ran,
body declaring what it produces: what a test of one operation
does. Fails as body does.
Sourcepub fn cached_builds(&self) -> usize
pub fn cached_builds(&self) -> usize
How many placed parts its build cache holds.
Sourcepub fn nested(&self, location: Location) -> Runner
pub fn nested(&self, location: Location) -> Runner
The runner of the part placed from the file of location: what an
editor edits a step of it with.
Sourcepub fn revision(&self, path: &str) -> u64
pub fn revision(&self, path: &str) -> u64
The revision of the file at path of its workspace: 0 without one.
Sourcepub fn files(&self) -> Vec<String>
pub fn files(&self) -> Vec<String>
The files the program it runs could read, as it names them: every file but its own. None without a workspace.
Sourcepub fn read(&self, name: &str) -> GeopResult<(String, Rc<str>)>
pub fn read(&self, name: &str) -> GeopResult<(String, Rc<str>)>
The text of the file the program it runs names name, and its path:
a file of bytes read as UTF-8, what is not replaced (see
crate::workspace::text). A make reads it through its reader,
which records the read (crate::reader::Reader::read_file).
Sourcepub fn read_bytes(&self, name: &str) -> GeopResult<(String, Rc<[u8]>)>
pub fn read_bytes(&self, name: &str) -> GeopResult<(String, Rc<[u8]>)>
The bytes of the file the program it runs names name, and its
path (see crate::workspace::bytes): what a reader of a binary
format reads (crate::reader::Reader::read_bytes).