pub trait Fold<'src> {
Show 17 methods
// Provided methods
fn fold_program<'new>(
&mut self,
arena: &'new Bump,
program: &Program<'_, 'src>,
) -> Program<'new, 'src> { ... }
fn fold_stmt<'new>(
&mut self,
arena: &'new Bump,
stmt: &Stmt<'_, 'src>,
) -> Stmt<'new, 'src> { ... }
fn fold_block<'new>(
&mut self,
arena: &'new Bump,
block: &Block<'_, 'src>,
) -> Block<'new, 'src> { ... }
fn fold_expr<'new>(
&mut self,
arena: &'new Bump,
expr: &Expr<'_, 'src>,
) -> Expr<'new, 'src> { ... }
fn fold_param<'new>(
&mut self,
arena: &'new Bump,
param: &Param<'_, 'src>,
) -> Param<'new, 'src> { ... }
fn fold_arg<'new>(
&mut self,
arena: &'new Bump,
arg: &Arg<'_, 'src>,
) -> Arg<'new, 'src> { ... }
fn fold_class_member<'new>(
&mut self,
arena: &'new Bump,
member: &ClassMember<'_, 'src>,
) -> ClassMember<'new, 'src> { ... }
fn fold_enum_member<'new>(
&mut self,
arena: &'new Bump,
member: &EnumMember<'_, 'src>,
) -> EnumMember<'new, 'src> { ... }
fn fold_property_hook<'new>(
&mut self,
arena: &'new Bump,
hook: &PropertyHook<'_, 'src>,
) -> PropertyHook<'new, 'src> { ... }
fn fold_type_hint<'new>(
&mut self,
arena: &'new Bump,
type_hint: &TypeHint<'_, 'src>,
) -> TypeHint<'new, 'src> { ... }
fn fold_attribute<'new>(
&mut self,
arena: &'new Bump,
attribute: &Attribute<'_, 'src>,
) -> Attribute<'new, 'src> { ... }
fn fold_catch_clause<'new>(
&mut self,
arena: &'new Bump,
catch: &CatchClause<'_, 'src>,
) -> CatchClause<'new, 'src> { ... }
fn fold_match_arm<'new>(
&mut self,
arena: &'new Bump,
arm: &MatchArm<'_, 'src>,
) -> MatchArm<'new, 'src> { ... }
fn fold_closure_use_var(
&mut self,
var: &ClosureUseVar<'src>,
) -> ClosureUseVar<'src> { ... }
fn fold_trait_use<'new>(
&mut self,
arena: &'new Bump,
trait_use: &TraitUseDecl<'_, 'src>,
) -> TraitUseDecl<'new, 'src> { ... }
fn fold_trait_adaptation<'new>(
&mut self,
arena: &'new Bump,
adaptation: &TraitAdaptation<'_, 'src>,
) -> TraitAdaptation<'new, 'src> { ... }
fn fold_name<'new>(
&mut self,
arena: &'new Bump,
name: &Name<'_, 'src>,
) -> Name<'new, 'src> { ... }
}Expand description
Trait for arena-to-arena PHP AST transformation.
All methods have identity-fold default implementations that call the
corresponding free fold_* function. Override only the node types you want
to change; the rest recurse automatically.
See the module documentation for design rationale and lifetime notes.
Provided Methods§
fn fold_program<'new>( &mut self, arena: &'new Bump, program: &Program<'_, 'src>, ) -> Program<'new, 'src>
fn fold_stmt<'new>( &mut self, arena: &'new Bump, stmt: &Stmt<'_, 'src>, ) -> Stmt<'new, 'src>
fn fold_block<'new>( &mut self, arena: &'new Bump, block: &Block<'_, 'src>, ) -> Block<'new, 'src>
fn fold_expr<'new>( &mut self, arena: &'new Bump, expr: &Expr<'_, 'src>, ) -> Expr<'new, 'src>
fn fold_param<'new>( &mut self, arena: &'new Bump, param: &Param<'_, 'src>, ) -> Param<'new, 'src>
fn fold_arg<'new>( &mut self, arena: &'new Bump, arg: &Arg<'_, 'src>, ) -> Arg<'new, 'src>
fn fold_class_member<'new>( &mut self, arena: &'new Bump, member: &ClassMember<'_, 'src>, ) -> ClassMember<'new, 'src>
fn fold_enum_member<'new>( &mut self, arena: &'new Bump, member: &EnumMember<'_, 'src>, ) -> EnumMember<'new, 'src>
fn fold_property_hook<'new>( &mut self, arena: &'new Bump, hook: &PropertyHook<'_, 'src>, ) -> PropertyHook<'new, 'src>
fn fold_type_hint<'new>( &mut self, arena: &'new Bump, type_hint: &TypeHint<'_, 'src>, ) -> TypeHint<'new, 'src>
fn fold_attribute<'new>( &mut self, arena: &'new Bump, attribute: &Attribute<'_, 'src>, ) -> Attribute<'new, 'src>
fn fold_catch_clause<'new>( &mut self, arena: &'new Bump, catch: &CatchClause<'_, 'src>, ) -> CatchClause<'new, 'src>
fn fold_match_arm<'new>( &mut self, arena: &'new Bump, arm: &MatchArm<'_, 'src>, ) -> MatchArm<'new, 'src>
fn fold_closure_use_var( &mut self, var: &ClosureUseVar<'src>, ) -> ClosureUseVar<'src>
fn fold_trait_use<'new>( &mut self, arena: &'new Bump, trait_use: &TraitUseDecl<'_, 'src>, ) -> TraitUseDecl<'new, 'src>
fn fold_trait_adaptation<'new>( &mut self, arena: &'new Bump, adaptation: &TraitAdaptation<'_, 'src>, ) -> TraitAdaptation<'new, 'src>
fn fold_name<'new>( &mut self, arena: &'new Bump, name: &Name<'_, 'src>, ) -> Name<'new, 'src>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".