pub struct Controller { /* private fields */ }

Implementations§

source§

impl Controller

source

pub fn new(pause: Duration) -> Controller

source

pub fn new_no_pause() -> Controller

source

pub fn new_max_pause() -> Controller

source

pub fn set_pause_duration(&mut self, pause_time: Duration)

Modifies the pause time, the duration the interpreter will block for before non-trivial AST interpretation waiting for a #unpause() or #cancel() call after the duration execution will continue automatically

source

pub fn pause_duration(&self) -> Duration

source

pub fn unpause(&mut self)

Unblocks current waiting phase’s execution, if it is blocked. Requires a recent (in terms of set pause_time) call to #refresh() to be valid

source

pub fn cancel(&mut self)

Requests any current executing interpreter be cancelled

source

pub fn current_phase(&self) -> Option<Phase>

Returns current execution phase, requires a recent (in terms of set pause_time) call to #refresh() to be valid

source

pub fn run_stats(&self) -> &RunStats

source

pub fn result(&self) -> Option<&Result<Int, BadderError>>

Returns result of execution

source

pub fn paused(&self) -> bool

Returns current execution is paused, requires a recent (in terms of set pause_time) call to #refresh() to be valid

source

pub fn refresh(&mut self) -> bool

Communicate with the current execution populates #result & #current_phase if available Returns if a change has taken place

source

pub fn add_external_function(&mut self, id: &str)

Adds an external function signature must be a valid badder signature to work ie some_ext_function(svv) for a 3 arg function taking a sequence & 2 variable arguments

source

pub fn clear_external_functions(&mut self)

source

pub fn current_external_call(&self) -> Option<ExternalCall>

source

pub fn answer_external_call(&mut self, result: Result<(Int, IntFlag), String>)

source

pub fn execute(&mut self, code: Ast)

Start executing code with a new thread. Effectively resets this instances state.

Trait Implementations§

source§

impl Debug for Controller

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> 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>,

§

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>,

§

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.