Enum adana_script_core::primitive::Primitive
source · #[repr(C)]pub enum Primitive {
Show 15 variants
Int(i128),
Bool(bool),
Ref(RefPrimitive),
Null,
Double(f64),
String(String),
Array(Vec<Primitive>),
Struct(BTreeMap<String, Primitive>),
Error(String),
Function {
parameters: Vec<Value>,
exprs: Vec<Value>,
},
Unit,
NoReturn,
EarlyReturn(Box<Primitive>),
NativeLibrary(Rc<NativeLibrary>),
NativeFunction(String, Rc<NativeLibrary>),
}
Variants§
Int(i128)
Bool(bool)
Ref(RefPrimitive)
Null
Double(f64)
String(String)
Array(Vec<Primitive>)
Struct(BTreeMap<String, Primitive>)
Error(String)
Function
Unit
NoReturn
EarlyReturn(Box<Primitive>)
NativeLibrary(Rc<NativeLibrary>)
NativeFunction(String, Rc<NativeLibrary>)
Implementations§
source§impl Primitive
impl Primitive
pub fn is_greater_than(&self, other: &Primitive) -> Primitive
pub fn is_greater_or_equal(&self, other: &Primitive) -> Primitive
pub fn is_less_than(&self, other: &Primitive) -> Primitive
pub fn is_less_or_equal(&self, other: &Primitive) -> Primitive
pub fn is_equal(&self, other: &Primitive) -> Primitive
pub fn as_ref_ok(&self) -> Result<&Primitive>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Primitive
impl<'de> Deserialize<'de> for Primitive
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Primitive> for Primitive
impl PartialEq<Primitive> for Primitive
source§impl PartialOrd<Primitive> for Primitive
impl PartialOrd<Primitive> for Primitive
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreAuto Trait Implementations§
impl RefUnwindSafe for Primitive
impl !Send for Primitive
impl !Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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