pub enum ValueKind {
Number(RationalInteger),
Measure(RationalInteger),
Text(String),
Date(SemanticDateTime),
Time(SemanticTime),
Boolean(bool),
Ratio(RationalInteger),
Range(Box<LiteralValue>, Box<LiteralValue>),
}Expand description
Value payload (shape of a literal). No type attached. Measure unit is required; Ratio unit is optional (see plan ratio-units-optional.md).
Variants§
Number(RationalInteger)
Measure(RationalInteger)
Measure: magnitude in canonical (base-unit) space.
At bind time the user-facing value is multiplied by unit.factor to produce
the stored magnitude; API unit maps divide back. Unit/signature identity
comes from the node/DataDefinition type via LemmaType::measure_runtime_signature.
Text(String)
Date(SemanticDateTime)
Time(SemanticTime)
Boolean(bool)
Ratio(RationalInteger)
Ratio: canonical magnitude. Display unit comes from the node/DataDefinition type.
Range(Box<LiteralValue>, Box<LiteralValue>)
Implementations§
Source§impl ValueKind
impl ValueKind
Sourcepub fn as_decimal_magnitude(&self) -> Result<Decimal, String>
pub fn as_decimal_magnitude(&self) -> Result<Decimal, String>
Decimal magnitude for numeric variants (number, measure, ratio).
Sourcepub fn structural_byte_size(&self) -> usize
pub fn structural_byte_size(&self) -> usize
Cheap structural byte-size estimate (no formatting, no rational→decimal).
Used by resource-limit checks where the exact string length is not required — only an upper-bound within a constant factor.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ValueKind
impl<'de> Deserialize<'de> for ValueKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ValueKind
Source§impl From<&ValueKind> for ValueKind
impl From<&ValueKind> for ValueKind
Source§fn from(value: &DomainValueKind) -> Self
fn from(value: &DomainValueKind) -> Self
impl StructuralPartialEq for ValueKind
Auto Trait Implementations§
impl Freeze for ValueKind
impl RefUnwindSafe for ValueKind
impl Send for ValueKind
impl Sync for ValueKind
impl Unpin for ValueKind
impl UnsafeUnpin for ValueKind
impl UnwindSafe for ValueKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.