Enum Primitive

Source
#[repr(C)]
pub enum Primitive {
Show 18 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>), LibData(LibData),
}

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>)

§

LibData(LibData)

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 duplicate 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 Json for Primitive

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

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

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

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

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

Source§

fn floor(&self) -> Self

Source§

fn ceil(&self) -> Self

Source§

fn round(&self, decimals: &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 StringManipulation for Primitive

Source§

fn match_regex(&self, regex: &Primitive) -> Self

Source§

fn is_match(&self, regex: &Primitive) -> Self

Source§

fn replace(&self, regex: &Primitive, new_value: &Primitive) -> Self

Source§

fn replace_all(&self, regex: &Primitive, new_value: &Primitive) -> Self

Source§

fn to_upper(&self) -> Self

Source§

fn to_lower(&self) -> Self

Source§

fn capitalize(&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_str(&self) -> &'static str

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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§

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>,

Source§

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>,

Source§

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>,