[−][src]Struct rcalc_lib::parse::CalcState
holds the current state of the engine, e.g list of all previously used variables
Fields
has_alt: bool
alt_result: String
Methods
impl CalcState
[src]
pub fn new() -> Self
[src]
pub fn constant(&self, name: &str) -> Option<Value>
[src]
Returns a constant value by its name. Name is caseinsensitive
pub fn variable(&self, name: &str) -> Option<Value>
[src]
Returns a variable value by its name. Name is caseinsensitive
pub fn add_variable(&mut self, name: &str, val: Value)
[src]
Creates a new variable or replace existing one with a new value. The function does not check variable's name for validity. In case of its name conflicts with existing function name, the variable will be inaccessible from expression evaluator
pub fn result(&self) -> Option<Value>
[src]
Returns the result of the last successful evaluation
pub fn variable_name_validate(&self, name: &str) -> Result<(), &'static str>
[src]
Check if variable name is valid:
- name convention
- does not conflict with any constant
- does not conflist with any function
- does not conflict with special variables, like
ans
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,