Skip to main content

Runner

Struct Runner 

Source
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: Location

Implementations§

Source§

impl Runner

Source

pub fn new(registry: OperationRegistry) -> Self

A runner of the operations of registry, of programs that read and place nothing.

Source

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.

Source

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.

Source

pub fn run_with( &self, part: &mut Part, program: &Program, inputs: &Settings, upto: Option<&str>, ) -> RunOutput

Runner::run, its parameters set to inputs.

Source

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.

Source

pub fn counts(&self) -> Counts

How much work it and the runners of the parts it placed did.

Source

pub fn cached_builds(&self) -> usize

How many placed parts its build cache holds.

Source

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.

Source

pub fn revision(&self, path: &str) -> u64

The revision of the file at path of its workspace: 0 without one.

Source

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.

Source

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).

Source

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).

Source

pub fn program(&self, name: &str) -> GeopResult<(Rc<Program>, Location)>

The program in the file the program it runs names name, and where it would be placed from here. Refuses a file placing the program it runs, however deep: the files would place themselves.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Runner

§

impl !Send for Runner

§

impl !Sync for Runner

§

impl !UnwindSafe for Runner

§

impl Freeze for Runner

§

impl Unpin for Runner

§

impl UnsafeUnpin for Runner

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.