pub struct RunnerState<'m, 'i> { /* private fields */ }Expand description
A RunnerState encapsulates a single in-flight process, executing code within a Metta runner
Implementations§
Source§impl<'m, 'input> RunnerState<'m, 'input>
impl<'m, 'input> RunnerState<'m, 'input>
Sourcepub fn new(metta: &'m Metta) -> Self
pub fn new(metta: &'m Metta) -> Self
Returns a new RunnerState to execute code in the context of a MeTTa runner’s top module
Sourcepub fn new_with_parser(
metta: &'m Metta,
parser: Box<dyn Parser + 'input>,
) -> Self
pub fn new_with_parser( metta: &'m Metta, parser: Box<dyn Parser + 'input>, ) -> Self
Returns a new RunnerState, for running code from the SExprParser with the specified Metta runner
Sourcepub fn new_with_atoms(metta: &'m Metta, atoms: &'input [Atom]) -> Self
pub fn new_with_atoms(metta: &'m Metta, atoms: &'input [Atom]) -> Self
Returns a new RunnerState, for running code encoded as a slice of [Atom]s with the specified Metta runner
Sourcepub fn run_to_completion(self) -> Result<Vec<Vec<Atom>>, String>
pub fn run_to_completion(self) -> Result<Vec<Vec<Atom>>, String>
Repeatedly steps a RunnerState until it is complete, and then returns the results
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true if the RunnerState has completed execution of all input or has encountered a
fatal error, otherwise returns false
Sourcepub fn current_results(&self) -> &Vec<Vec<Atom>>
pub fn current_results(&self) -> &Vec<Vec<Atom>>
Returns a reference to the current in-progress results within the RunnerState
Sourcepub fn into_results(self) -> Vec<Vec<Atom>>
pub fn into_results(self) -> Vec<Vec<Atom>>
Consumes the RunnerState and returns the final results
Trait Implementations§
Auto Trait Implementations§
impl<'m, 'i> Freeze for RunnerState<'m, 'i>
impl<'m, 'i> !RefUnwindSafe for RunnerState<'m, 'i>
impl<'m, 'i> !Send for RunnerState<'m, 'i>
impl<'m, 'i> !Sync for RunnerState<'m, 'i>
impl<'m, 'i> Unpin for RunnerState<'m, 'i>
impl<'m, 'i> !UnwindSafe for RunnerState<'m, 'i>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request