Expand description
A MutVisitor
represents an AST modification; it accepts an AST piece and
mutates it in place. So, for instance, macro expansion is a MutVisitor
that walks over an AST and modifies it.
Note: using a MutVisitor
(other than the MacroExpander
MutVisitor
) on
an AST before macro expansion is probably a bad idea. For instance,
a MutVisitor
renaming item names in a module will miss all of those
that are created by the expansion of a macro.
Enums§
Traits§
- Some value for the AST node that is valid but possibly meaningless. Similar to
Default
but not intended for wide use. The value will never be used meaningfully, it exists just to support unwinding invisit_clobber
in the case where its closure panics.
Functions§
- visit_attr_args π
- visit_attr_tt π
- visit_attr_tts π
- visit_attrs π
- visit_bounds π
- Use a map-style function (
FnOnce(T) -> T
) to overwrite a&mut T
. Useful when using aflat_map_*
orfilter_map_*
method within avisit_
method. - visit_const_item π
- visit_constness π
- visit_defaultness π
- visit_delim_args π
- visit_exprs π
- visit_lazy_tts π
- visit_nonterminal πApplies the visitor to elements of interpolated nodes.
- visit_opt π
- visit_polarity π
- visit_safety π
- visit_thin_exprs π
- visit_thin_vec π
- Applies ident visitor if itβs an ident; applies other visits to interpolated nodes. In practice the ident part is not actually used by specific visitors right now, but thereβs a test below checking that it works.
- visit_tt π
- visit_tts π
- visit_vec π
- walk_anon_const π
- walk_attribute π
- walk_capture_by π
- walk_closure_binder π
- walk_coroutine_kind π
- Mutates one item, returning the item again.
- walk_fn π
- walk_fn_decl π
- walk_fn_header π
- walk_fn_ret_ty π
- walk_foreign_mod π
- walk_format_args π
- walk_generic_arg π
- walk_generic_args π
- walk_generics π
- walk_ident π
- walk_inline_asm π
- walk_inline_asm_sym π
- walk_label π
- walk_lifetime π
- walk_local π
- walk_mac π
- walk_macro_def π
- walk_meta_item π
- walk_meta_list_item π
- walk_mt π
- walk_param_bound π
- walk_path π
- walk_path_segment π
- walk_poly_trait_ref π
- walk_qself π
- walk_trait_ref π
- walk_use_tree π
- walk_variant_data π
- walk_vis π
- walk_where_clause π
- walk_where_predicate π