Value

Enum Value 

Source
pub enum Value {
Show 46 variants U8(Ref<u8>), U16(Ref<u16>), U32(Ref<u32>), U64(Ref<u64>), U128(Ref<u128>), I8(Ref<i8>), I16(Ref<i16>), I32(Ref<i32>), I64(Ref<i64>), I128(Ref<i128>), F32(Ref<F32>), F64(Ref<F64>), String(Ref<String>), Bool(Ref<bool>), Atom(u64), MatrixIndex(Matrix<usize>), MatrixBool(Matrix<bool>), MatrixU8(Matrix<u8>), MatrixU16(Matrix<u16>), MatrixU32(Matrix<u32>), MatrixU64(Matrix<u64>), MatrixU128(Matrix<u128>), MatrixI8(Matrix<i8>), MatrixI16(Matrix<i16>), MatrixI32(Matrix<i32>), MatrixI64(Matrix<i64>), MatrixI128(Matrix<i128>), MatrixF32(Matrix<F32>), MatrixF64(Matrix<F64>), MatrixString(Matrix<String>), MatrixRationalNumber(Matrix<RationalNumber>), MatrixComplexNumber(Matrix<ComplexNumber>), MatrixValue(Matrix<Value>), ComplexNumber(Ref<ComplexNumber>), RationalNumber(Ref<RationalNumber>), Set(MechSet), Map(MechMap), Record(Ref<MechRecord>), Table(Ref<MechTable>), Tuple(MechTuple), Id(u64), Index(Ref<usize>), MutableReference(MutableReference), Kind(ValueKind), IndexAll, Empty,
}

Variants§

§

U8(Ref<u8>)

§

U16(Ref<u16>)

§

U32(Ref<u32>)

§

U64(Ref<u64>)

§

U128(Ref<u128>)

§

I8(Ref<i8>)

§

I16(Ref<i16>)

§

I32(Ref<i32>)

§

I64(Ref<i64>)

§

I128(Ref<i128>)

§

F32(Ref<F32>)

§

F64(Ref<F64>)

§

String(Ref<String>)

§

Bool(Ref<bool>)

§

Atom(u64)

§

MatrixIndex(Matrix<usize>)

§

MatrixBool(Matrix<bool>)

§

MatrixU8(Matrix<u8>)

§

MatrixU16(Matrix<u16>)

§

MatrixU32(Matrix<u32>)

§

MatrixU64(Matrix<u64>)

§

MatrixU128(Matrix<u128>)

§

MatrixI8(Matrix<i8>)

§

MatrixI16(Matrix<i16>)

§

MatrixI32(Matrix<i32>)

§

MatrixI64(Matrix<i64>)

§

MatrixI128(Matrix<i128>)

§

MatrixF32(Matrix<F32>)

§

MatrixF64(Matrix<F64>)

§

MatrixString(Matrix<String>)

§

MatrixRationalNumber(Matrix<RationalNumber>)

§

MatrixComplexNumber(Matrix<ComplexNumber>)

§

MatrixValue(Matrix<Value>)

§

ComplexNumber(Ref<ComplexNumber>)

§

RationalNumber(Ref<RationalNumber>)

§

Set(MechSet)

§

Map(MechMap)

§

Record(Ref<MechRecord>)

§

Table(Ref<MechTable>)

§

Tuple(MechTuple)

§

Id(u64)

§

Index(Ref<usize>)

§

MutableReference(MutableReference)

§

Kind(ValueKind)

§

IndexAll

§

Empty

Implementations§

Source§

impl Value

Source

pub fn convert_to(&self, other: &ValueKind) -> Option<Value>

Source

pub fn size_of(&self) -> usize

Source

pub fn to_html(&self) -> String

Source

pub fn shape(&self) -> Vec<usize>

Source

pub fn deref_kind(&self) -> ValueKind

Source

pub fn kind(&self) -> ValueKind

Source

pub fn is_matrix(&self) -> bool

Source

pub fn is_scalar(&self) -> bool

Source

pub fn as_bool(&self) -> Option<Ref<bool>>

Source

pub fn as_i8(&self) -> Option<Ref<i8>>

Source

pub fn as_i16(&self) -> Option<Ref<i16>>

Source

pub fn as_i32(&self) -> Option<Ref<i32>>

Source

pub fn as_i64(&self) -> Option<Ref<i64>>

Source

pub fn as_i128(&self) -> Option<Ref<i128>>

Source

pub fn as_u8(&self) -> Option<Ref<u8>>

Source

pub fn as_u16(&self) -> Option<Ref<u16>>

Source

pub fn as_u32(&self) -> Option<Ref<u32>>

Source

pub fn as_u64(&self) -> Option<Ref<u64>>

Source

pub fn as_u128(&self) -> Option<Ref<u128>>

Source

pub fn as_string(&self) -> Option<Ref<String>>

Source

pub fn as_rationalnumber(&self) -> Option<Ref<RationalNumber>>

Source

pub fn as_complexnumber(&self) -> Option<Ref<ComplexNumber>>

Source

pub fn as_f32(&self) -> Option<Ref<F32>>

Source

pub fn as_f64(&self) -> Option<Ref<F64>>

Source

pub fn as_vecbool(&self) -> Option<Vec<bool>>

Source

pub fn as_vecf64(&self) -> Option<Vec<F64>>

Source

pub fn as_vecf32(&self) -> Option<Vec<F32>>

Source

pub fn as_vecu8(&self) -> Option<Vec<u8>>

Source

pub fn as_vecu16(&self) -> Option<Vec<u16>>

Source

pub fn as_vecu32(&self) -> Option<Vec<u32>>

Source

pub fn as_vecu64(&self) -> Option<Vec<u64>>

Source

pub fn as_vecu128(&self) -> Option<Vec<u128>>

Source

pub fn as_veci8(&self) -> Option<Vec<i8>>

Source

pub fn as_veci16(&self) -> Option<Vec<i16>>

Source

pub fn as_veci32(&self) -> Option<Vec<i32>>

Source

pub fn as_veci64(&self) -> Option<Vec<i64>>

Source

pub fn as_veci128(&self) -> Option<Vec<i128>>

Source

pub fn as_vecstring(&self) -> Option<Vec<String>>

Source

pub fn as_vecrationalnumber(&self) -> Option<Vec<RationalNumber>>

Source

pub fn as_veccomplexnumber(&self) -> Option<Vec<ComplexNumber>>

Source

pub fn as_vecusize(&self) -> Option<Vec<usize>>

Source

pub fn as_index(&self) -> MResult<Value>

Source

pub fn as_usize(&self) -> Option<usize>

Source

pub fn expect_u8(&self) -> MResult<Ref<u8>>

Source

pub fn expect_f64(&self) -> MResult<Ref<F64>>

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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 CompileConst for Value

Source§

fn compile_const(&self, ctx: &mut CompileCtx) -> MResult<u32>

Source§

impl Debug for Value

Source§

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

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

impl Display for Value

Source§

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

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

impl From<F32> for Value

Source§

fn from(val: F32) -> Self

Converts to this type from the input type.
Source§

impl From<F64> for Value

Source§

fn from(val: F64) -> Self

Converts to this type from the input type.
Source§

impl From<RationalNumber> for Value

Source§

fn from(val: RationalNumber) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(val: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(val: bool) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Value

Source§

fn from(val: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(val: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(val: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(val: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(val: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Value

Source§

fn from(val: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(val: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(val: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.
Source§

impl Hash for Value

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> 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 PrettyPrint for Value

Source§

impl ToMatrix for Value

Source§

fn to_matrix(elements: Vec<Self>, rows: usize, cols: usize) -> Matrix<Self>

Source§

fn to_matrixd(elements: Vec<Self>, rows: usize, cols: usize) -> Matrix<Self>

Source§

impl Eq for Value

Source§

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> 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> Scalar for T
where T: 'static + Clone + PartialEq + Debug,