pub enum Value {
Null,
Int(i64),
Float(f64),
Bool(bool),
Char(char),
String(String),
Vector(Rc<RefCell<Vec<Self>>>),
Object(Rc<RefCell<Object>>),
UserObject(Rc<RefCell<Box<dyn UserObject>>>),
Function(FunctionKind),
}Variants§
Null
Int(i64)
Float(f64)
Bool(bool)
Char(char)
String(String)
Vector(Rc<RefCell<Vec<Self>>>)
Object(Rc<RefCell<Object>>)
UserObject(Rc<RefCell<Box<dyn UserObject>>>)
Function(FunctionKind)
Implementations§
Source§impl Value
impl Value
pub fn typ(&self) -> &'static str
pub fn dynamic_typ(&self) -> String
pub fn call_tostring( &self, interpreter: &mut Interpreter, ) -> Result<String, Located<RunTimeError>>
Trait Implementations§
Source§impl From<Box<dyn Fn(&mut Interpreter, Vec<Value>) -> Result<Value, Box<dyn Error>>>> for Value
impl From<Box<dyn Fn(&mut Interpreter, Vec<Value>) -> Result<Value, Box<dyn Error>>>> for Value
Source§fn from(value: Box<UserFunction>) -> Self
fn from(value: Box<UserFunction>) -> Self
Converts to this type from the input type.
Source§impl From<Rc<dyn Fn(&mut Interpreter, Vec<Value>) -> Result<Value, Box<dyn Error>>>> for Value
impl From<Rc<dyn Fn(&mut Interpreter, Vec<Value>) -> Result<Value, Box<dyn Error>>>> for Value
Source§fn from(value: Rc<UserFunction>) -> Self
fn from(value: Rc<UserFunction>) -> Self
Converts to this type from the input type.
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