#[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

Fields

§parameters: Vec<Value>
§exprs: Vec<Value>
§

Unit

§

NoReturn

§

EarlyReturn(Box<Primitive>)

§

NativeLibrary(Arc<NativeLibrary>)

§

NativeFunction(String, Arc<NativeLibrary>)

Implementations§

source§

impl Primitive

source

pub fn ref_prim(self) -> RefPrimitive

source

pub fn to_value(self) -> Result<Value>

source§

impl Primitive

source

pub fn is_greater_than(&self, other: &Primitive) -> Primitive

source

pub fn is_greater_or_equal(&self, other: &Primitive) -> Primitive

source

pub fn is_less_than(&self, other: &Primitive) -> Primitive

source

pub fn is_less_or_equal(&self, other: &Primitive) -> Primitive

source

pub fn is_equal(&self, other: &Primitive) -> Primitive

source

pub fn as_ref_ok(&self) -> Result<&Primitive>

Trait Implementations§

source§

impl Abs for Primitive

source§

fn abs(&self) -> Self

source§

impl Add for Primitive

source§

fn add(&self, rhs: &Self) -> Self

source§

impl And for Primitive

source§

fn and(&self, rhs: &Self) -> Self

source§

fn bitwise_and(&self, rhs: &Self) -> Self

source§

impl Array for Primitive

source§

fn index_at(&self, rhs: &Primitive) -> Primitive

source§

fn len(&self) -> Primitive

source§

fn swap_mem(&mut self, rhs: &mut Primitive, index: &Primitive) -> Primitive

source§

fn remove(&mut self, key: &Primitive) -> Result<()>

source§

fn is_empty(&self) -> Primitive

source§

impl BitShift for Primitive

source§

fn right_shift(&self, rhs: &Self) -> Self

source§

fn left_shift(&self, rhs: &Self) -> Self

source§

impl Clone for Primitive

source§

fn clone(&self) -> Primitive

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Cos for Primitive

source§

fn cos(&self) -> Self

source§

impl Debug for Primitive

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Primitive

source§

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 Display for Primitive

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DisplayBinary for Primitive

source§

fn to_binary(&self) -> Self

source§

impl DisplayHex for Primitive

source§

fn to_hex(&self) -> Self

source§

impl Div for Primitive

source§

fn div(&self, rhs: &Self) -> Self

source§

impl Logarithm for Primitive

source§

fn log(&self) -> Self

source§

fn ln(&self) -> Self

source§

impl Mul for Primitive

source§

fn mul(&self, rhs: &Self) -> Self

source§

impl Neg for Primitive

source§

fn neg(&self) -> Self

source§

impl Not for Primitive

source§

fn not(&self) -> Self

source§

fn bitwise_not(&self) -> Self

source§

impl Or for Primitive

source§

fn or(&self, rhs: &Self) -> Self

source§

fn bitwise_or(&self, rhs: &Self) -> Self

source§

fn bitwise_xor(&self, rhs: &Self) -> Self

source§

impl PartialEq for Primitive

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Primitive

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Pow for Primitive

source§

fn pow(&self, rhs: &Self) -> Self

source§

impl Rem for Primitive

source§

fn rem(&self, rhs: &Self) -> Self

source§

impl Serialize for Primitive

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Sin for Primitive

source§

fn sin(&self) -> Self

source§

impl Sqrt for Primitive

source§

fn sqrt(&self) -> Self

source§

impl Sub for Primitive

source§

fn sub(&self, rhs: &Self) -> Self

source§

impl Tan for Primitive

source§

fn tan(&self) -> Self

source§

impl ToBool for Primitive

source§

fn to_bool(&self) -> Self

source§

impl ToNumber for Primitive

source§

fn to_int(&self) -> Self

source§

fn to_double(&self) -> Self

source§

impl TypeOf for Primitive

source§

fn type_of(&self) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,