pub struct AiInterpreter { /* private fields */ }Implementations§
Source§impl Interpreter
impl Interpreter
pub fn new(program: Vec<Op>) -> Interpreter
pub fn from_ir(program: &str) -> Result<Interpreter, Error>
pub fn from_program(program: Program) -> Interpreter
pub fn run(program: Program) -> Result<(), Error>
pub fn register_callable( &mut self, name: &str, callable: Box<dyn CallableGenerator>, ) -> Result<(), Error>
pub fn register_property( &mut self, name: &str, prop: Box<dyn Prop>, ) -> Result<(), Error>
pub fn interpret(&mut self) -> Result<(), Error>
pub fn reset(&mut self) -> Result<(), Error>
pub fn end(&mut self) -> Result<(), Error>
pub fn step(&mut self) -> Result<InterpreterState, Error>
Trait Implementations§
impl Send for Interpreter
impl Sync for Interpreter
Auto Trait Implementations§
impl !Freeze for Interpreter
impl !RefUnwindSafe for Interpreter
impl Unpin for Interpreter
impl !UnwindSafe for Interpreter
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
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 more