pub fn get_all_rules() -> Vec<&'static Rule<'static>>Expand description
Returns a copied Vec of all rules registered with the register_rule macro.
Rules are not guaranteed to be in any particular order.
ยงExample
#[register_rule]
fn identity(expr: &Expression, symbols: &SymbolTable) -> ApplicationResult {
Ok(Reduction::pure(expr.clone()))
}
fn main() {
println!("Rules: {:?}", get_all_rules());
}This will print (if no other rules are registered):
Rules: [Rule { name: "identity", application: MEM }]Where MEM is the memory address of the identity function.