Expand description
Traversal helpers for intra-function entities.
FuncAt<P>/FuncAtMut<P> are like (&FuncDefBody, P)/(&mut FuncDefBody, P)
(where P is some type describing a “position” in the function), except:
- they only borrow the
EntityDefsfields ofFuncDefBody- this can prevent borrow conflicts, especially when mutating other fields
- it also avoids accidentally accessing parts of the function definition
without going through
P(asEntityDefsrequires keys for any access)
- they’re dedicated types with inherent methods and trait
impls