Enum umbra_lang::Value [−][src]
pub enum Value {
Type(Arc<Type>, Arc<HashableMap<String, RefTVal>>),
Reference(RefTVal),
Internal(InternalData),
Number(BigRational),
String(String),
List(Vec<RefTVal>),
Map(HashableMap<RefTVal, RefTVal>),
Enum(Arc<Vec<(String, Arc<Type>)>>, Box<(String, Vec<RefTVal>)>),
Struct(HashableMap<String, RefTVal>),
Function {
args: Arc<Vec<(String, Arc<Type>)>>,
vars: HashableMap<String, RefTVal>,
body: Callable,
},
Thread(ThreadHandle),
}
Expand description
A representation of any valid value in a script.
Variants
A Type
with subtype values.
Reference(RefTVal)
A reference to another value.
Tuple Fields of Reference
0: RefTVal
Internal data for storing state
Number(BigRational)
Any rational number.
Tuple Fields of Number
0: BigRational
String(String)
Any UTF8 string.
Tuple Fields of String
0: String
An array of values.
A one-to-one mapping of values. Any value is valid for keys.
A sum type represented by the possible variants and the specific variant name and its value.
Enum comparison is currently done via string comparison which should change in the future.
A structure containing fields and their values.
Methods may be defined just like any other values, however there is no
inheritance. Use composition via trait
instead.
Any Callable
along with its argument types and the associated flattened
environment.
Fields of Function
Thread(ThreadHandle)
A ThreadHandle
of a running thread. May be joined for FnReturn
.
Tuple Fields of Thread
0: ThreadHandle
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more