Closed hanusek closed 11 months ago
Hello @bertiqwerty I trying wrap FlaxEx in my struct:
#[derive(Debug, Clone, PartialOrd, PartialEq, Validate)] pub struct QuickExpression { #[validate(length(min = 1), custom = "validate_expression")] raw_text: String, //expr: exmex::FlatEx<exmex::Val, exmex::ValOpsFactory, exmex::ValMatcher>, //expr: exmex::FlatEx<Val<i64>, exmex::ValOpsFactory<i64>, exmex::ValMatcher>, } impl QuickExpression { pub fn do_something(&self) { let big_num = 0xF1F2F3F4F5F6F7u64 as i64; let res = self.expr.eval(&[bin_num]); //... } }
I need to work with f64 and i64:
let text = "2 * {random_value}"; let expr = exmex::parse_val::<i64, f64>(text.as_str()); let my_expr = QuickExpression{raw_text: text, expr: expr};
Hi @hanusek, you can use exmex::FlatExVal<i64, f64> as type in your struct.
exmex::FlatExVal<i64, f64>
struct
If you have any open question, feel free to re-open.
Hello @bertiqwerty I trying wrap FlaxEx in my struct:
I need to work with f64 and i64: