Struct qoqo_calculator::Calculator [−][src]
Struct for parsing string expressions to floats
Fields
variables: HashMap<String, f64>
HashMap of variables in current Calculator
Implementations
impl Calculator
[src]
pub fn new() -> Self
[src]
Create new Calculator.
pub fn set_variable(&mut self, name: &str, value: f64)
[src]
Set variable for Calculator.
Arguments
name
- Name of the variablevalue
- Float value of the variable
pub fn get_variable(&self, name: &str) -> Result<f64, CalculatorError>
[src]
pub fn parse_str(&mut self, expression: &str) -> Result<f64, CalculatorError>
[src]
pub fn parse_get(
&mut self,
parse_variable: CalculatorFloat
) -> Result<f64, CalculatorError>
[src]
&mut self,
parse_variable: CalculatorFloat
) -> Result<f64, CalculatorError>
Function parse_get
Parse a CalculatorFloat to float
Arguments
parse_variable
- Parsed string CalculatorFloat or returns float value
Trait Implementations
impl Clone for Calculator
[src]
fn clone(&self) -> Calculator
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Calculator
[src]
impl Default for Calculator
[src]
Auto Trait Implementations
impl RefUnwindSafe for Calculator
impl Send for Calculator
impl Sync for Calculator
impl Unpin for Calculator
impl UnwindSafe for Calculator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,