Skip to main content

Module exec

Module exec 

Source

Structs§

Engine
Host-extension engine: the single front door for registering Rust functions and types and running scripts against them.
EngineOutput
Output of one Engine run: the final working directory, the filesystem handle the run executed against, and the top-level script variable bindings captured at completion.
ExecIo
ExecState
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.
FuncMeta
Introspectable metadata for one function. Single source for DESCRIBE(name) output and the static function reference. rpn names whether the function also runs on the compiled math path (true for pure functions and opted-in stateful ones); everything runs on the AST path.
FuncParam
One declared parameter of a registered function. param_type is None for unconstrained Value parameters (the macro accepts any value).
FunctionRegistry
The single function registry: DSL FUNC definitions, builtins, and host extensions share one lookup table, one metadata path, and one dispatch order. Script entries scope lexically (defined names revert on scope exit, shadowing an outer definition restores it); native entries persist for the run. Shared across fork() via clone; the entry maps clone while scope frames stay per state.
HostModule
One host library: functions and types registered under a single module name. Engine::register_module stages these; runs expose them as MODULE::NAME calls with MODULE provenance on every entry.
LazyRunOutput
Output of a lazily-executed run (issue #131): the final working directory (concretized as of return), shared ownership of the snapshot backing dir, and the filesystem handle for post-hoc convergence (e.g. concretizing the cwd after shell-entry materialization).
StepCtx
Per-step execution context handed to every command handler.
TypeDescriptor
Vtable for one type: lifecycle plus operations. All hooks are plain function pointers (never closures) so descriptors stay Copy and the global table hands them out by value. Every hook documents the payload domain it expects; calling one with a foreign payload is unsound, and every call site is a single choke point reviewed with the layout.
Value

Enums§

FuncKind
Origin of a callable in the unified function registry. Script is an interpreted FUNC body; HostCtx and HostPure are compiled Rust functions (the #[oxdock_func] host export macro). Builtins and runtime-registered hosts share the host kinds; only DESCRIBE output shows the label, and both host kinds keep rendering as host.
HostRegistration
One host-registered function, grouped into a HostModule and passed to Engine::register_module. Build the entry with the #[oxdock_func]- generated registration marker, or by hand. Pure entries run on both the AST and the compiled RPN math paths; Stateful entries run on the AST path with full step context.

Constants§

SNAPSHOT_PENDING_DISPLAY
Display text emitted by CWD while the snapshot root is selected but not yet materialized (issue #131). Single source of truth: the cwd handler prints this value, and the logic-test harness resolves the same value from @SNAPSHOT_PENDING@ fixture tokens.
SNAPSHOT_TREE_UNAVAILABLE
Fallback tree body used when a materialized snapshot cannot be described while composing a run error (issue #131). Single source of truth for the lazy error path.

Traits§

OxDockFn
Export hook for a DSL function, implemented by #[oxdock_func] on a registration marker. The engine calls registration() and never names a generated symbol.
OxDockType
Export hook for a DSL payload type, implemented by #[oxdock_type] on the payload struct itself. The canonical descriptor singleton backs every word of the type; user code never names a generated symbol.

Functions§

builtin_function_metas
Metadata of every builtin function, sorted by name, for static rendering (docs-gen). Same single source as builtin_function_names: the #[oxdock_func] annotations, never a parallel list.
builtin_function_names
Names of all compiled-in builtins plus INSPECT (a dedicated AST/RPN node, not a registry entry). Read straight off a stock registry, so the #[oxdock_func] annotations stay the single source of truth: adding a builtin extends this set with no parallel list to update. Seeds parse-time shadow validation, so the parser crate keeps zero compile-time knowledge of builtin names.
clone_boxed⚠
Heap clone: deep-copy the box.
clone_copy⚠
Inline clone: payloads are plain bytes.
clone_shared⚠
Shared-heap clone: bump the Arc strong count, sharing the buffer. O(1) with no allocation.
drop_boxed⚠
Heap drop: free the box.
drop_noop⚠
Inline drop: nothing owns anything.
drop_shared⚠
Shared-heap drop: release one Arc strong count, freeing the buffer only when the final word drops.
enrich_lazy_error
Error enrichment for lazy runs: a materialized snapshot gets the same filesystem-snapshot treatment as eager runs; a pending one reports that no snapshot directory was ever created instead of describing a tree. Chain rendering is identical to the eager path (shared composer).
eq_boxed⚠
Heap eq: compare the boxed values.
eq_inline⚠
Inline eq: reconstruct both sides and compare.
eq_shared⚠
Shared-heap eq: compare the shared values.
fmt_boxed⚠
Heap fmt: render the boxed value.
fmt_inline⚠
Inline fmt: reconstruct and render.
fmt_shared⚠
Shared-heap fmt: render the shared value.
load_inline⚠
Reconstruct a Copy value from an inline payload.
run_steps
run_steps_with_context
run_steps_with_context_result
Execute the DSL and return the final working directory after all steps.
run_steps_with_context_result_with_io
run_steps_with_fs
run_steps_with_fs_with_io
run_steps_with_lazy_snapshot
Execute the DSL against a lazily-created snapshot: no temporary directory exists until the first snapshot-targeted resolution. The snapshot handle is shared with the resolver, so all clones observe the same directory.
run_steps_with_manager
Host introspection entry point: execute the DSL against a caller-provided filesystem and return the final working directory, the filesystem handle, and the top-level script variable bindings captured at Flow::Done. Bindings are read from the root variable scope only, so ephemeral variables from FUNC bodies, FOR/WHILE iterations, and ASYNC blocks are excluded. On script failure the scope is discarded with the error and no bindings are returned.
run_steps_with_manager_with_modules
Same as run_steps_with_manager, plus host modules and types. Each module’s functions become callable as MODULE::NAME with full step context; each type descriptor becomes visible to TYPES() and valid for LET $x: NAME declarations carrying same-named opaque payloads. Authors should derive entries with #[oxdock_func] / #[oxdock_type] (see oxdock-func-macro) and group them into HostModule instead of hand-writing metadata and glue.
startup_descriptors
Canonical descriptors of the ten startup types, in a fixed order, for seeding per-state name directories and static rendering (docs-gen). Each entry is the payload struct’s own singleton: no table, no lock.
std_module_table
Stock STD module table derived from the #[oxdock_func] builtins: the single source of truth for builtin membership and RPN eligibility. Seeds parse-time module resolution, so the parser crate keeps zero compile-time knowledge of builtin names.
store_inline
Copy a Copy value’s bytes into a payload. Panics when T exceeds 64 bits: such types must use the heap path.
type_anchor
Anchor of a type’s reference section, derived from its name the way the Markdown slugger derives it from the doc title.
unshare_boxed⚠
Exclusive-heap unshare: the box is already uniquely owned, so the payload is returned unchanged with no allocation.
unshare_inline⚠
Inline unshare: inline words hold bytes, not a heap buffer, so there is nothing to hand out mutably. Panics: reaching this hook means Value::read_heap_mut was called with an inline descriptor, a caller bug (mirrors store_inline’s size assert).
unshare_shared⚠
Shared-heap unshare: detach on write. When the strong count is 1 the payload is returned unchanged (in-place, no allocation); otherwise the buffer is cloned, the word is rewritten to the private buffer, and the other clones keep the original. Either way the returned pointer addresses a buffer this word uniquely owns.

Type Aliases§

NativeFn
Stateful/IO function with full step context (fs, cwd, envs, vars, pipes).
PureFn
Pure scalar function: no filesystem, no scope, no process access. Usable from both AST evaluation and compiled RPN math.

Unions§

ValuePayload
Payload half of a Value word: either the value’s bytes inline or a thin pointer to an owned Box<T> (exclusive heaps) or a shared Arc<T> (shared heaps), as the type’s descriptor dictates. Inline and pointer domains never mix for a given TypeDescriptor.