Skip to main content

Module value

Module value 

Source

Structs§

StructLayout
Indexed runtime layout for a Harn struct instance.
VmAtomicHandle
An atomic integer handle for the VM.
VmChannelHandle
A channel handle for the VM (uses tokio mpsc).
VmClosure
A compiled closure value.
VmEnv
VM environment for variable storage.
VmGenerator
A generator object: lazily produces values via yield. The generator body runs as a spawned task that sends values through a channel.
VmRange
A lazy integer range — Python-style. Stores only (start, end, inclusive) so the in-memory footprint is O(1) regardless of the range’s length. len(), indexing (r[k]), .contains(x), .first(), .last() are all O(1); direct iteration walks step-by-step without materializing a list.
VmSyncPermitHandle
A held synchronization permit for mutex/semaphore/gate primitives.
VmTaskHandle
A spawned async task handle with cancellation support.

Enums§

ErrorCategory
Error categories for structured error handling in agent orchestration.
VmError
VmValue
VM runtime value.

Functions§

categorized_error
Create a categorized error conveniently.
classify_error_message
Classify an error message using HTTP status codes and well-known patterns. Prefers unambiguous signals (status codes) over substring heuristics.
closest_match
Find the closest match from a list of candidates using Levenshtein distance. Returns Some(suggestion) if a candidate is within max_dist edits.
compare_values
error_to_category
Extract error category from a VmError.
struct_fields_to_map
value_identity_key
Stable identity key for a value. Different allocations produce different keys; two values with the same heap identity produce the same key. For primitives the key is derived from the displayed value plus type name so logically-equal primitives always compare equal.
value_structural_hash_key
Canonical string form used as the keying material for hash_value. Different types never collide (the type name is prepended) and collection order is preserved so structurally-equal values always produce the same key. Not intended for cross-process stability; depends on the in-process iteration order for collections (Dict uses BTreeMap so keys are sorted).
values_equal
values_identical
Reference / identity equality. For heap-allocated refcounted values (List/Dict/Set/Closure) returns true only when both operands share the same underlying Rc allocation. For primitive scalars, falls back to structural equality (since primitives have no distinct identity).

Type Aliases§

ModuleFunctionRegistry
ModuleState
VmAsyncBuiltinFn
An async builtin function for the VM.
VmBuiltinFn
Sync builtin function for the VM.
VmJoinHandle
The raw join handle type for spawned tasks.