pub enum Value {
Show 18 variants
Unit,
Bool(bool),
Int(i64),
Float(f64),
Char(char),
Str(String),
Tuple(Vec<Value>),
List(Vec<Value>),
Option(Option<Box<Value>>),
Range(i64, i64),
FloatRange(f64, f64),
Closure(Rc<Closure>),
State(State<Value>),
Binding(Binding<Value>),
Result(Result<Box<Value>, Box<Value>>),
Record(Rc<Record>),
Place(Rc<RefCell<Value>>),
Host(Host),
}Expand description
A value of the interpreted program.
Variants§
Unit
().
Bool(bool)
true or false.
Int(i64)
A whole number of any integer type.
Float(f64)
A number with a fraction, of either float type.
Char(char)
A character.
Str(String)
Text: a String or a &str.
Tuple(Vec<Value>)
A tuple.
List(Vec<Value>)
A vector, an array or what an iterator yields.
Option(Option<Box<Value>>)
Some(..) or None.
Range(i64, i64)
a..b or a..=b, as the numbers it gives.
FloatRange(f64, f64)
A range of floats, which only says what it contains: 0.1..0.9.
Closure(Rc<Closure>)
A closure of the program.
State(State<Value>)
A State of the program, holding interpreter values.
Binding(Binding<Value>)
A binding that reads and writes part of another, as Binding::map makes.
Result(Result<Box<Value>, Box<Value>>)
Ok(..) or Err(..).
Record(Rc<Record>)
A value of a struct the program declares itself.
Place(Rc<RefCell<Value>>)
A place a closure was given to change, as |n| *n += 1 gets.
Host(Host)
An object of the host program.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl !UnwindSafe for Value
impl Freeze for Value
impl Unpin for Value
impl UnsafeUnpin 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