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
impl Value
pub fn convert_to(&self, other: &ValueKind) -> Option<Value>
pub fn size_of(&self) -> usize
pub fn to_html(&self) -> String
pub fn shape(&self) -> Vec<usize>
pub fn deref_kind(&self) -> ValueKind
pub fn kind(&self) -> ValueKind
pub fn is_matrix(&self) -> bool
pub fn is_scalar(&self) -> bool
pub fn as_bool(&self) -> Option<Ref<bool>>
pub fn as_i8(&self) -> Option<Ref<i8>>
pub fn as_i16(&self) -> Option<Ref<i16>>
pub fn as_i32(&self) -> Option<Ref<i32>>
pub fn as_i64(&self) -> Option<Ref<i64>>
pub fn as_i128(&self) -> Option<Ref<i128>>
pub fn as_u8(&self) -> Option<Ref<u8>>
pub fn as_u16(&self) -> Option<Ref<u16>>
pub fn as_u32(&self) -> Option<Ref<u32>>
pub fn as_u64(&self) -> Option<Ref<u64>>
pub fn as_u128(&self) -> Option<Ref<u128>>
pub fn as_string(&self) -> Option<Ref<String>>
pub fn as_rationalnumber(&self) -> Option<Ref<RationalNumber>>
pub fn as_complexnumber(&self) -> Option<Ref<ComplexNumber>>
pub fn as_f32(&self) -> Option<Ref<F32>>
pub fn as_f64(&self) -> Option<Ref<F64>>
pub fn as_vecbool(&self) -> Option<Vec<bool>>
pub fn as_vecf64(&self) -> Option<Vec<F64>>
pub fn as_vecf32(&self) -> Option<Vec<F32>>
pub fn as_vecu8(&self) -> Option<Vec<u8>>
pub fn as_vecu16(&self) -> Option<Vec<u16>>
pub fn as_vecu32(&self) -> Option<Vec<u32>>
pub fn as_vecu64(&self) -> Option<Vec<u64>>
pub fn as_vecu128(&self) -> Option<Vec<u128>>
pub fn as_veci8(&self) -> Option<Vec<i8>>
pub fn as_veci16(&self) -> Option<Vec<i16>>
pub fn as_veci32(&self) -> Option<Vec<i32>>
pub fn as_veci64(&self) -> Option<Vec<i64>>
pub fn as_veci128(&self) -> Option<Vec<i128>>
pub fn as_vecstring(&self) -> Option<Vec<String>>
pub fn as_vecrationalnumber(&self) -> Option<Vec<RationalNumber>>
pub fn as_veccomplexnumber(&self) -> Option<Vec<ComplexNumber>>
pub fn as_vecusize(&self) -> Option<Vec<usize>>
pub fn as_index(&self) -> MResult<Value>
pub fn as_usize(&self) -> Option<usize>
pub fn expect_u8(&self) -> MResult<Ref<u8>>
pub fn expect_f64(&self) -> MResult<Ref<F64>>
Trait Implementations§
Source§impl CompileConst for Value
impl CompileConst for Value
fn compile_const(&self, ctx: &mut CompileCtx) -> MResult<u32>
Source§impl From<RationalNumber> for Value
impl From<RationalNumber> for Value
Source§fn from(val: RationalNumber) -> Self
fn from(val: RationalNumber) -> Self
Converts to this type from the input type.
Source§impl PrettyPrint for Value
impl PrettyPrint for Value
fn pretty_print(&self) -> String
impl Eq for Value
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.