pub enum Value {
Show 13 variants
Object(ScopePtr),
Patch(Thunk),
Array(Vec<Thunk>),
Number(f64),
String(String),
Boolean(bool),
FunctionCall {
f: Thunk,
args: Vec<Thunk>,
},
BuiltinFn(BuiltinFn),
Lambda {
scope: ScopePtr,
arg_names: Vec<String>,
expr: Rc<AstNode>,
},
BinOp {
kind: BinOp,
left: Thunk,
right: Thunk,
},
Name(ScopePtr, String),
Attribute {
value: Thunk,
attr: String,
},
Null,
}Variants§
Object(ScopePtr)
Patch(Thunk)
Array(Vec<Thunk>)
Number(f64)
String(String)
Boolean(bool)
FunctionCall
BuiltinFn(BuiltinFn)
Lambda
BinOp
Name(ScopePtr, String)
Attribute
Null
Implementations§
Source§impl Value
impl Value
pub fn is_primitive(&self) -> bool
pub fn at(&self, index: usize) -> Result<Rc<Value>, Error>
pub fn attr(&self, attr: &str) -> Result<Rc<Value>, Error>
pub fn str(&self) -> Result<&str, Error>
pub fn number(&self) -> Result<f64, Error>
pub fn bool(&self) -> Result<bool, Error>
pub fn is_null(&self) -> bool
pub fn pretty_indented( &self, indent: usize, _color: bool, f: &mut Formatter<'_>, ) -> Result
pub fn pretty(&self, color: bool, f: &mut Formatter<'_>) -> Result
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Value
impl !RefUnwindSafe for Value
impl !Send for Value
impl !Sync for Value
impl Unpin 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