pub enum RuntimeValue {
Scalar(f64),
Bool(bool),
Int(i64),
Label {
index_name: IndexTypeRef,
variant: IndexVariantName,
},
Struct {
type_name: StructTypeRef,
fields: IndexMap<FieldName, Self>,
},
Indexed {
index_name: IndexTypeRef,
entries: IndexMap<IndexVariantName, Self>,
},
RangeLabel {
step_index: usize,
value: f64,
},
Datetime(Epoch),
}Expand description
A runtime value: either a scalar (f64 in SI units), a bool, a struct, or an indexed collection.
Variants§
Scalar(f64)
Bool(bool)
Int(i64)
Label
Internal carrier for a named-index loop case.
The type checker prevents this from escaping as a user value; evaluation
uses it only for index access and match dispatch.
Struct
Fields
type_name: StructTypeRefConcrete constructor/type leaf for display plus optional canonical owning struct type.
Tagged-union values keep the constructor leaf here (e.g. LowThrust) while
module-aware evaluation stores the owning union’s canonical StructType identity
in the carrier’s resolved field.
Indexed
An indexed collection: maps variant names to values, preserving declaration order.
RangeLabel
A range index label during Unfold iteration.
Carries the step index and SI value (for arithmetic like t - prev_t).
Datetime(Epoch)
A datetime instant (internally stored as a hifitime::Epoch).
Implementations§
Source§impl RuntimeValue
impl RuntimeValue
Sourcepub fn label_with_owner(
owner: DagId,
index_name: IndexName,
variant: IndexVariantName,
) -> Self
pub fn label_with_owner( owner: DagId, index_name: IndexName, variant: IndexVariantName, ) -> Self
Construct a label value after resolving the index leaf into an owner.
Sourcepub fn resolved_label(resolved: &ResolvedIndexVariant) -> Self
pub fn resolved_label(resolved: &ResolvedIndexVariant) -> Self
Construct a module-aware label value from a resolved index-variant reference.
Sourcepub fn struct_with_owner(
owner: DagId,
type_name: StructTypeName,
fields: IndexMap<FieldName, Self>,
) -> Self
pub fn struct_with_owner( owner: DagId, type_name: StructTypeName, fields: IndexMap<FieldName, Self>, ) -> Self
Construct a struct value after resolving the struct leaf into an owner.
Sourcepub fn indexed_with_owner(
owner: DagId,
index_name: IndexName,
entries: IndexMap<IndexVariantName, Self>,
) -> Self
pub fn indexed_with_owner( owner: DagId, index_name: IndexName, entries: IndexMap<IndexVariantName, Self>, ) -> Self
Construct an indexed value after resolving the index leaf into an owner.
Sourcepub fn kind(&self) -> RuntimeValueKind
pub fn kind(&self) -> RuntimeValueKind
Return the RuntimeValueKind of this value.
Sourcepub fn expect_scalar(&self, context: &str) -> Result<f64, RuntimeValueError>
pub fn expect_scalar(&self, context: &str) -> Result<f64, RuntimeValueError>
Extract scalar value, returning a structured error if this is not a scalar.
(Type mismatches should be caught by dim_check; this is defense-in-depth.)
Sourcepub fn expect_bool(&self, context: &str) -> Result<bool, RuntimeValueError>
pub fn expect_bool(&self, context: &str) -> Result<bool, RuntimeValueError>
Extract boolean value, returning a structured error if this is not a Bool.
(Type mismatches should be caught by dim_check; this is defense-in-depth.)
Trait Implementations§
Source§impl Clone for RuntimeValue
impl Clone for RuntimeValue
Source§fn clone(&self) -> RuntimeValue
fn clone(&self) -> RuntimeValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more