pub struct MathEval<'a> { /* private fields */ }Expand description
Math evaluator state
Implementations§
Source§impl<'a> MathEval<'a>
impl<'a> MathEval<'a>
pub fn new(input: &'a str) -> Self
pub fn with_variables(self, vars: HashMap<String, MathNum>) -> Self
Sourcepub fn with_string_variables(self, vars: &HashMap<String, String>) -> Self
pub fn with_string_variables(self, vars: &HashMap<String, String>) -> Self
Inject variables from string->string mapping (for shell integration)
Sourcepub fn extract_string_variables(&self) -> HashMap<String, String>
pub fn extract_string_variables(&self) -> HashMap<String, String>
Extract modified variables as string->string mapping (for shell integration)
pub fn with_c_precedences(self, enable: bool) -> Self
pub fn with_force_float(self, enable: bool) -> Self
pub fn with_octal_zeroes(self, enable: bool) -> Self
pub fn with_lastval(self, val: i32) -> Self
Sourcepub fn get_variables(&self) -> &HashMap<String, MathNum>
pub fn get_variables(&self) -> &HashMap<String, MathNum>
Get updated variables after evaluation
Auto Trait Implementations§
impl<'a> Freeze for MathEval<'a>
impl<'a> RefUnwindSafe for MathEval<'a>
impl<'a> Send for MathEval<'a>
impl<'a> Sync for MathEval<'a>
impl<'a> Unpin for MathEval<'a>
impl<'a> UnsafeUnpin for MathEval<'a>
impl<'a> UnwindSafe for MathEval<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more