Enum num_parser::Value
source · [−]Expand description
Represent every possible output value.
Variants
Int(i64)
Float(f64)
Complex(Complex64)
Vector(Vec<Value>)
Bool(bool)
Implementations
sourceimpl Value
impl Value
pub fn add(self, rhs: Self) -> EvalResult<Self>
pub fn sub(self, rhs: Self) -> EvalResult<Self>
pub fn mul(self, rhs: Self) -> EvalResult<Self>
pub fn div(self, rhs: Self) -> EvalResult<Self>
pub fn negate(self) -> EvalResult<Self>
pub fn exponentiation(self, rhs: Self) -> EvalResult<Self>
pub fn modulo(self, rhs: Self) -> EvalResult<Self>
pub fn less_than(self, rhs: Self) -> EvalResult<Self>
pub fn greater_than(self, rhs: Self) -> EvalResult<Self>
pub fn less_or_equal_to(self, rhs: Self) -> EvalResult<Self>
pub fn greater_or_equal_to(self, rhs: Self) -> EvalResult<Self>
pub fn logical_and(self, rhs: Self) -> EvalResult<Self>
pub fn logical_or(self, rhs: Self) -> EvalResult<Self>
pub fn equal_to(self, rhs: Self) -> EvalResult<Self>
pub fn not_equal_to(self, rhs: Self) -> EvalResult<Self>
pub fn not(self) -> EvalResult<Self>
sourceimpl Value
impl Value
pub fn get_type(&self) -> ValueType
pub fn is_int(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_complex(&self) -> bool
pub fn is_vector(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn as_int(&self) -> EvalResult<i64>
pub fn as_float(&self) -> EvalResult<f64>
pub fn as_complex(&self) -> EvalResult<Complex64>
pub fn as_vector(&self) -> Vec<Value>
pub fn as_bool(&self) -> EvalResult<bool>
pub fn as_type(&self, valuetype: &ValueType) -> EvalResult<Value>
sourcepub fn from_string(string: String) -> EvalResult<Self>
pub fn from_string(string: String) -> EvalResult<Self>
Creates a new value from a string.
sourcepub fn try_as_type(&self, valuetype: ValueType) -> Value
pub fn try_as_type(&self, valuetype: ValueType) -> Value
Tries to convert the value to the requested value-type. It returns the lowest complexity value achieved.
pub fn round(&self, rounding: Rounding) -> Self
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more