pub enum Value {
Show 18 variants
Int(i64),
Float(f64),
Str(String),
Bool(bool),
Unit,
Ok(Box<Value>),
Err(Box<Value>),
Some(Box<Value>),
None,
List(Vec<Value>),
Tuple(Vec<Value>),
Map(HashMap<Value, Value>),
ListSlice {
items: Rc<Vec<Value>>,
start: usize,
},
Fn {
name: String,
params: Vec<(String, String)>,
effects: Vec<String>,
body: Rc<FnBody>,
resolution: Option<FnResolution>,
memo_eligible: bool,
home_globals: Option<Rc<HashMap<String, Rc<Value>>>>,
},
Builtin(String),
Variant {
type_name: String,
variant: String,
fields: Vec<Value>,
},
Record {
type_name: String,
fields: Vec<(String, Value)>,
},
Namespace {
name: String,
members: HashMap<String, Value>,
},
}Variants§
Int(i64)
Float(f64)
Str(String)
Bool(bool)
Unit
Ok(Box<Value>)
Err(Box<Value>)
Some(Box<Value>)
None
List(Vec<Value>)
Tuple(Vec<Value>)
Map(HashMap<Value, Value>)
ListSlice
Shared list view (items[start..]) to avoid O(n^2) tail copying in
recursive list processing.
Fn
Fields
§
resolution: Option<FnResolution>Compile-time resolution metadata (slot layout for locals).
Builtin(String)
Variant
User-defined sum type variant, e.g. Shape.Circle(3.14)
Record
User-defined product type (record), e.g. User(name = "Alice", age = 30)
Namespace
Type namespace: Shape — provides Shape.Circle, Shape.Rect, etc.
Trait Implementations§
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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
Mutably borrows from an owned value. Read more