Skip to main content

Runner

Struct Runner 

Source
pub struct Runner<'a> { /* private fields */ }
Expand description

Runs plans in a folder, with an agent and a person.

Implementations§

Source§

impl<'a> Runner<'a>

Source

pub fn new( folder: &Path, agent: &'a dyn Agent, person: &'a mut dyn Person, ) -> Self

A runner for plans that work in folder, finding other plans by name in the same folder.

Source

pub fn plans_in(&mut self, plans: &Path) -> &mut Self

Finds the plans that steps name in this folder, name.vpf.json.

Source

pub fn time_limit(&mut self, limit: Duration) -> &mut Self

Ends each run within this time, even when its plan allows more. A run that goes on later has this time again.

Source

pub fn clock(&mut self, clock: Box<dyn Clock + 'a>) -> &mut Self

Reads and waits on this clock instead of the computer’s.

Source

pub fn keep_records(&mut self, name: &str) -> &mut Self

Keeps a record of each run in the folder’s .vpf/runs, under the plan’s name, and keeps to the plan’s limits.month across them.

Source

pub fn detach(&mut self, detach: bool) -> &mut Self

Asks no one and waits for no time: whatever a run would ask a person, and any time it would wait for, leaves it waiting, holding nothing, while the steps that do not wait for it go on.

Source

pub fn at_once(&mut self, most: usize) -> &mut Self

Has no more than this many agents and commands work at once, 8 when not told. Steps that wait for none of each other, and the items of a step, are done at the same time up to it.

Source

pub fn keeper(&mut self, keeper: &'a mut dyn Keeper) -> &mut Self

Hands each entry a run keeps to keeper as soon as it is kept, and tells it each record a run begins with, so that a host keeps the run in its own store.

Source

pub fn run(&mut self, plan: &Plan, asked: &str) -> Record

Runs a plan that has no problems, started with asked.

Source

pub fn resume(&mut self, record: &Record) -> Record

Goes on with a run from its record: from where it stands, with the replies it was given since and the last version of its plan, asking nothing again that it was given before.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Runner<'a>

§

impl<'a> !Send for Runner<'a>

§

impl<'a> !Sync for Runner<'a>

§

impl<'a> !UnwindSafe for Runner<'a>

§

impl<'a> Forget for Runner<'a>

§

impl<'a> Freeze for Runner<'a>

§

impl<'a> Move for Runner<'a>

§

impl<'a> Unpin for Runner<'a>
where *const u8 is !null: Unpin, &'a dyn Agent: Unpin, &'a mut dyn Person: Unpin, Box<dyn Clock + 'a>: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, &'static str: Unpin, *const LeafNode<String, Seen> is !null: Unpin, Box<(String, Seen)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, &'a mut dyn Keeper: Unpin,

§

impl<'a> UnsafeUnpin for Runner<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.