Skip to main content

Machine

Struct Machine 

Source
pub struct Machine {
    pub name: String,
    pub doc: u64,
    pub inputs: Vec<Bound>,
    pub output: Option<Place>,
    pub executed: u64,
    pub time_limit_ms: f64,
    pub dry_run: bool,
    pub stopped: Option<(String, bool)>,
    pub partial: Option<(String, String)>,
    pub last_params: Option<Value>,
    pub wrote_files: Vec<String>,
    /* private fields */
}
Expand description

A macro run in progress: which step is next, and what has run.

Fields§

§name: String§doc: u64§inputs: Vec<Bound>§output: Option<Place>§executed: u64

Steps executed so far (each pass through a Repeat counts).

§time_limit_ms: f64§dry_run: bool

Dry run (the footprint check): steps that would touch files or can’t be previewed stop the run early instead of running.

§stopped: Option<(String, bool)>

A Stop step ended the run: its message, and whether it asked for a rollback.

§partial: Option<(String, String)>

A dry run stopped before this step (path, reason): what follows isn’t in the footprint.

§last_params: Option<Value>

The last step’s resolved parameters (for the debugger).

§wrote_files: Vec<String>

Files the run wrote (“step 1 (file.exportCsv)”): rolling the run back doesn’t take them back.

Implementations§

Source§

impl Machine

Source

pub fn new(p: &Prepared, dry_run: bool) -> Machine

Source

pub fn is_done(&self) -> bool

Source

pub fn restart_clock(&mut self)

Starts the time limit again (the debugger gives each action its own).

Source

pub fn current_json(&self, wb: &Workbook) -> Json

The current step for the debugger: its path, kind, command, parameters as they would run now, and the Repeat pass.

Source

pub fn current(&self) -> Option<(String, &Step)>

The step that runs next, with its path.

Source

pub fn iteration(&self) -> Option<(u32, u32)>

The innermost Repeat’s pass (1-based) and count.

Source

pub fn run_to_end(&mut self, s: &mut Session) -> Result<(), StepError>

Runs every remaining step.

Source

pub fn step(&mut self, s: &mut Session) -> Result<(), StepError>

Runs the current step and moves to the next one.

Trait Implementations§

Source§

impl Clone for Machine

Source§

fn clone(&self) -> Machine

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Machine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.