pub struct ExecState<P: ProcessManager> { /* private fields */ }Expand description
Execution state for one script run. Public so hosts can register functions and introspect listings; all fields stay crate-private so the scope, recursion-budget, and task invariants cannot be broken from outside.
Implementations§
Source§impl<P: ProcessManager> ExecState<P>
impl<P: ProcessManager> ExecState<P>
Sourcepub fn register_module(&mut self, module: HostModule<P>)
pub fn register_module(&mut self, module: HostModule<P>)
Register one HostModule: every function becomes callable as
MODULE::NAME, every type joins the run’s name directory.
Sourcepub fn list_functions(&self) -> Vec<FuncMeta>
pub fn list_functions(&self) -> Vec<FuncMeta>
All visible functions: natives plus hosts plus current DSL definitions.
Sourcepub fn describe_function(&self, name: &str) -> Option<Value>
pub fn describe_function(&self, name: &str) -> Option<Value>
Describe one function by name, or None when unknown.
Source§impl<P: ProcessManager> ExecState<P>
impl<P: ProcessManager> ExecState<P>
Sourcepub fn register_type(&mut self, descriptor: &'static TypeDescriptor)
pub fn register_type(&mut self, descriptor: &'static TypeDescriptor)
Register a host-defined type descriptor (usually T::descriptor()
for a #[oxdock_type] payload). Makes the name visible to TYPES()
and valid for LET $x: NAME declarations carrying same-named
payloads. Re-registering a name returns silently when the descriptor
is identical; a different descriptor under a live name panics
instead of aliasing two layouts.
Sourcepub fn is_known_type(&self, name: &str) -> bool
pub fn is_known_type(&self, name: &str) -> bool
True when name names a registered type (startup or host).
Sourcepub fn describe_type(&self, name: &str) -> Option<&'static TypeDescriptor>
pub fn describe_type(&self, name: &str) -> Option<&'static TypeDescriptor>
Resolve a descriptor by name, or None when unregistered.
Sourcepub fn type_names(&self) -> Vec<String>
pub fn type_names(&self) -> Vec<String>
Every registered type name: startup descriptors first, then hosts in registration order.