pub enum Value {
String(String),
Number(f64),
List(Vec<Ref<Self>>),
Tree(BTreeMap<String, Ref<Self>>),
Function(Function<Machine, (), Machine>),
Error(String),
None,
}
Variants§
String(String)
Number(f64)
List(Vec<Ref<Self>>)
Tree(BTreeMap<String, Ref<Self>>)
Function(Function<Machine, (), Machine>)
Error(String)
None
Implementations§
Source§impl Value
impl Value
Sourcepub fn function(
f: impl 'static + Fn(&mut Machine),
context: &Machine,
) -> Ref<Self>
pub fn function( f: impl 'static + Fn(&mut Machine), context: &Machine, ) -> Ref<Self>
Creates a reference to a Function with a captured context, basically a Closure
Sourcepub fn call(&self, machine: &mut Machine)
pub fn call(&self, machine: &mut Machine)
Call this function in the context of the Machine captured when this instance of the function was created
Sourcepub fn call_global(&self, machine: &mut Machine)
pub fn call_global(&self, machine: &mut Machine)
Call this function in the context of the current machine, meaning, execute the instructions of this function as if they were not in a function.
pub fn is_err(&self) -> bool
Trait Implementations§
Source§impl Add for Value
impl Add for Value
############################################################## The following traits are for implementing operators and logic! ############################################################## Add two values
Source§impl From<Value> for bool
impl From<Value> for bool
############################################################ The following traits are for implementing foreign functions! ############################################################ Convert Value into a bool
Source§impl IntoIterator for Value
impl IntoIterator for Value
Convert Value into Iter
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq 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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)