/// global metadata. If the rule is applicable to the subtree, it should return `Some(<new_tree>)`,
/// As the engine traverses the tree (in left-most, outer-most order), it will apply rules to each
/// If a rule is applicable to the given node/subtree (i.e. can transform it), then it should return
/// the resulting new subtree, which will be inserted into the tree in place of the original node.
/// The [`Commands`] instance passed to the rule can be used to apply side-effects after the rule
/// has been applied. This can be used to update global metadata, or to apply transformations to the
/// Casting an `fn` pointer or closure to this type allows it to be passed directly to the engine.
/// implements [`Rule`], to allow these to be passed directly to the engine instead of defining a
/// This makes simple cases less verbose. For more complex use cases with many rules it may better