11 releases (3 stable)

1.0.2 Sep 27, 2022
1.0.1 Mar 5, 2022
1.0.0 May 4, 2021
0.4.0 Feb 2, 2021
0.1.0 Jun 14, 2020

#541 in Template engine

Download history 303/week @ 2023-11-26 350/week @ 2023-12-03 279/week @ 2023-12-10 402/week @ 2023-12-17 344/week @ 2023-12-24 382/week @ 2023-12-31 256/week @ 2024-01-07 263/week @ 2024-01-14 174/week @ 2024-01-21 283/week @ 2024-01-28 381/week @ 2024-02-04 249/week @ 2024-02-11 413/week @ 2024-02-18 459/week @ 2024-02-25 387/week @ 2024-03-03 295/week @ 2024-03-10

1,582 downloads per month
Used in 6 crates (5 directly)

MIT license

31KB
637 lines

MIT Latest Version docs Chat on Miaou

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.

bet is designed around separation of building, transformations, and evaluation, so that an expression can be efficiently applied on many inputs. bet is designed for very fast evaluation.

bet is used in broot to let users type composite queries on files.

bet is used in rhit to filter log lines.

bet is used in lfs to filter filesystems.

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.

No runtime deps