Skip to main content

Module basic

Module basic 

Source
Expand description

Basic AST mutations: add, remove, rename, change visibility

These are fundamental building blocks for code transformations.

Modules§

stmt
Statement-level mutations for PureStmt/PureExpr operations

Structs§

AddConstMutation
Add a constant to the file
AddDeriveMutation
Add a derive macro to a struct or enum
AddEnumMutation
Add a new enum to the file
AddFieldMutation
Add a field to an existing struct
AddFunctionMutation
Add a new function to the file
AddImplMutation
Add an impl block for a type
AddItemMutation
Add an item from raw source code content
AddMatchArmMutation
Add a match arm to an existing match expression in a function
AddMethodMutation
Add a method to a struct or enum
AddPureItemsMutation
Add multiple items directly from AST (no parsing overhead)
AddStructLiteralFieldMutation
Add a field to all struct literals of a given struct type
AddStructMutation
Add a new struct to the file
AddTypeAliasMutation
Add a type alias to the file
AddUseMutation
Add a use statement to the file
AddVariantMutation
Add a variant to an existing enum
ChangeVisibilityMutation
Change visibility of an item or struct field
CreateModMutation
Create a new module with content
EnumToTraitMutation
Convert an enum to a trait with struct implementations
ExtractTraitMutation
Extract a trait from an impl block
FieldInfo
Field information for struct variants
InlineTraitMutation
Inline a trait back into a struct (remove trait, make inherent impl)
MoveItemMutation
Move an item from one module to another
RemoveConstMutation
Remove a constant from the file
RemoveDeriveMutation
Remove a derive macro from a struct or enum
RemoveEnumMutation
Remove an enum from the file
RemoveFieldMutation
Remove a field from a struct
RemoveFunctionMutation
Remove a function from the file
RemoveImplMutation
Remove an impl block from the file
RemoveItemMutation
Remove an item by SymbolId
RemoveMatchArmMutation
Remove a match arm from an existing match expression in a function
RemoveMethodMutation
Remove a method from a struct or enum
RemoveModMutation
Remove a module declaration from the file
RemoveStructLiteralFieldMutation
Remove a field from all struct literals of a given struct type
RemoveStructMutation
Remove a struct from the file
RemoveTraitMutation
Remove a trait from the file
RemoveTypeAliasMutation
Remove a type alias from the file
RemoveUseMutation
Remove a use statement from the file
RemoveVariantMutation
Remove a variant from an enum
RenameMutation
Rename a symbol across the file
ReplaceMatchArmMutation
Replace a match arm (pattern + body) in an existing match expression
VariantInfo
Information about an enum variant for conversion

Enums§

EnumToTraitStrategy
Strategy for enum-to-trait conversion
MatchHandling
How to handle match expressions on the converted enum