Enum adana_script_core::primitive::Primitive
source · #[repr(C)]pub enum Primitive {
Show 17 variants
U8(u8),
I8(i8),
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(Arc<NativeLibrary>),
NativeFunction(String, Arc<NativeLibrary>),
}
Variants§
U8(u8)
I8(i8)
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(Arc<NativeLibrary>)
NativeFunction(String, Arc<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 BitShift for Primitive
impl BitShift for Primitive
fn right_shift(&self, rhs: &Self) -> Self
fn left_shift(&self, rhs: &Self) -> Self
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 for Primitive
impl PartialEq for Primitive
source§impl PartialOrd for Primitive
impl PartialOrd 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 Freeze for Primitive
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