A library building and preparing expressions, for example boolean expressions such as (A | B) & !(C | D | E)
, which can be executed on dynamic contents.
An expression is built by calling the push_operator
, open_par
, close_par
and push_atom
functions.
It can then be evaluated with the eval
function which takes as parameters
- a function which gives a value to an atom
- a function which, given an operator and one or two values, gives a new value
- a function deciding whether to short-circuit
Normal evaluation order is left to right but is modified with parenthesis.
Defining features:
- performances
- ability to separate building, transformations, and evaluation, so that an expression can be efficiently applied on millions of inputs
Usage and documentation: docs.rs/bet
If you wonder whether bet could be applied to your problems, don't hesitate to come and discuss. If you know a documented crate with overlapping use cases, tell me too so that I may list it here as alternative.