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
EntityDefs
fields 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
(asEntityDefs
requires keys for any access)
- they’re dedicated types with inherent methods and trait
impl
s
Structs
- Immutable traversal (i.e. visiting) helper for intra-function entities.
- Mutable traversal (i.e. transforming) helper for intra-function entities.