Skip to main content

fionn_core/
value.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2//! Operation values for DSON operations
3//!
4//! This module defines the value types that can be used in DSON operations.
5//! Values are designed to be zero-copy references where possible.
6
7/// Values that can be operated on (references to avoid allocation)
8#[derive(Debug, Clone, PartialEq, Eq)]
9pub enum OperationValue {
10    /// String value
11    StringRef(String),
12    /// Number value (stored as string for precision)
13    NumberRef(String),
14    /// Boolean value
15    BoolRef(bool),
16    /// Null value
17    Null,
18    /// Object reference (tape position range)
19    ObjectRef {
20        /// Start position in tape
21        start: usize,
22        /// End position in tape
23        end: usize,
24    },
25    /// Array reference (tape position range)
26    ArrayRef {
27        /// Start position in tape
28        start: usize,
29        /// End position in tape
30        end: usize,
31    },
32}