pub struct Interpreter<'a> {
pub output: Vec<String>,
/* private fields */
}Fields§
§output: Vec<String>The program’s output lines. Public API consumed by ui_bridge.
Implementations§
Source§impl<'a> Interpreter<'a>
impl<'a> Interpreter<'a>
pub fn new(interner: &'a Interner) -> Self
Sourcepub fn with_program_args(self, args: Vec<String>) -> Self
pub fn with_program_args(self, args: Vec<String>) -> Self
Supply the program arguments read by the args() system native. The
vector is the full argv (index 0 is the program name), matching the
compiled binary’s env::args().
Sourcepub fn with_kernel(self, ctx: Arc<Context>) -> Self
pub fn with_kernel(self, ctx: Arc<Context>) -> Self
Phase 102: Set the kernel context for inductive type support.
When set, the interpreter can query the kernel for inductive types and constructors, enabling unified type system.
Sourcepub fn with_policies(self, registry: PolicyRegistry) -> Self
pub fn with_policies(self, registry: PolicyRegistry) -> Self
Set the policy registry for security checks.
Sourcepub fn with_type_registry(self, registry: &TypeRegistry) -> Self
pub fn with_type_registry(self, registry: &TypeRegistry) -> Self
Populate struct_defs from a TypeRegistry (DiscoveryPass results).
This allows the interpreter to initialize default field values for
structs created with new Point (no explicit fields).
Sourcepub fn with_output_callback(self, callback: OutputCallback) -> Self
pub fn with_output_callback(self, callback: OutputCallback) -> Self
Set a callback for streaming output.
The callback is called each time Show executes, with the output line.
Sourcepub fn is_kernel_inductive(&self, name: &str) -> bool
pub fn is_kernel_inductive(&self, name: &str) -> bool
Phase 102: Check if a name is a kernel inductive type.
Sourcepub fn get_kernel_constructors(&self, name: &str) -> Vec<(String, usize)>
pub fn get_kernel_constructors(&self, name: &str) -> Vec<(String, usize)>
Phase 102: Get constructors for a kernel inductive type.
Returns a vector of (constructor_name, arity) pairs.
Sourcepub async fn run(&mut self, stmts: &[Stmt<'a>]) -> Result<(), String>
pub async fn run(&mut self, stmts: &[Stmt<'a>]) -> Result<(), String>
Execute a program (list of statements). Phase 55: Now async for VFS operations.
pub fn values_equal_pub( &self, left: &RuntimeValue, right: &RuntimeValue, ) -> bool
Sourcepub fn global_bindings(&self) -> Vec<(String, String, String)>
pub fn global_bindings(&self) -> Vec<(String, String, String)>
The program’s global bindings after execution, as sorted
(name, type, value) rows — the substrate for the REPL’s :vars
inspection (see crate::repl::ReplSession::vars).
Auto Trait Implementations§
impl<'a> Freeze for Interpreter<'a>
impl<'a> !RefUnwindSafe for Interpreter<'a>
impl<'a> !Send for Interpreter<'a>
impl<'a> !Sync for Interpreter<'a>
impl<'a> Unpin for Interpreter<'a>
impl<'a> UnsafeUnpin for Interpreter<'a>
impl<'a> !UnwindSafe for Interpreter<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.