Skip to main content

Module value

Module value 

Source

Structs§

ArgTypeMismatchError
ArityMismatchError
DeadlockError
Payload for VmError::Deadlock. kind is the primitive kind ("mutex", "channel") or "task"; key is the primitive key or task id; detail names the specific footgun.
StructInstanceData
Runtime layout + slots for a VmValue::StructInstance.
StructLayout
Indexed runtime layout for a Harn struct instance.
VmAtomicHandle
An atomic integer handle for the VM.
VmBuiltinRefId
Boxed payload for VmValue::BuiltinRefId.
VmChannelCloseState
VmChannelHandle
A channel handle for the VM (uses tokio mpsc).
VmClosure
A compiled closure value.
VmEnumVariant
Runtime payload for a Harn enum variant.
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.
VmRngHandle
A reproducible random number generator handle.
VmSet
Backing store for VmValue::Set.
VmStream
A stream object: lazily produces values from a gen fn.
VmStreamCancel
VmSyncPermitHandle
A held synchronization permit for mutex/semaphore/gate primitives.
VmTaskHandle
A spawned async task handle with cancellation support.

Enums§

ArityExpect
Bound expressing how many arguments a callable accepts. Used in VmError::ArityMismatch so error messages can render the exact signature contract the caller violated.
ErrorCategory
Error categories for structured error handling in agent orchestration.
VmError
VmValue
VM runtime value.

Traits§

DictRetain
retain for the persistent DictMap.
VmDictExt
Field-insertion helpers for a VmValue::Dict backing map.

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
Total-order comparison used for sorting, min/max, and similar reductions.
dedup_values
Structural de-duplication that honors values_equal, preserving first-occurrence order.
error_to_category
Extract error category from a VmError.
intern_key
Intern a dict key into a shared HarnStr.
string_char_count
Character count with a byte-length fast path for ASCII text.
struct_fields_to_map
try_compare_values
Ordered comparison for relational operators. Returns None when the two values are unordered — i.e. a floating-point NaN is involved (directly, via an int/float mix, or nested inside a pair or list). Callers implementing <, >, <=, >= must treat None as “comparison is false”.
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 shared allocation. For primitive scalars, falls back to structural equality (since primitives have no distinct identity).

Type Aliases§

DictMap
Backing store for VmValue::Dict: a persistent, ordered, structurally shared map.
HarnStr
Thin, reference-counted, immutable UTF-8 string used by every string-shaped VmValue variant (String, BuiltinRef, TaskHandle).
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.
VmMutex