pub enum SerializableMutation {
Show 30 variants
Rename {
symbol_id: String,
to: String,
},
ChangeVisibility {
symbol_id: String,
visibility: String,
},
AddFunction {
symbol_id: String,
name: String,
params: Vec<(String, String)>,
return_type: Option<String>,
body: String,
is_pub: bool,
},
RemoveFunction {
symbol_id: String,
},
AddStruct {
name: String,
fields: Vec<(String, String, bool)>,
is_pub: bool,
},
RemoveStruct {
name: String,
},
AddField {
struct_name: String,
field_name: String,
field_type: String,
is_pub: bool,
},
RemoveField {
struct_name: String,
field_name: String,
},
AddUse {
path: String,
},
RemoveUse {
path: String,
},
AddDerive {
symbol_id: String,
derives: Vec<String>,
},
RemoveDerive {
symbol_id: String,
derives: Vec<String>,
},
AddEnum {
symbol_id: String,
name: String,
variants: Vec<String>,
derives: Vec<String>,
is_pub: bool,
},
RemoveEnum {
symbol_id: String,
},
AddVariant {
enum_name: String,
variant_name: String,
},
RemoveVariant {
enum_name: String,
variant_name: String,
},
AddMatchArm {
symbol_id: String,
enum_name: String,
pattern: String,
body: String,
},
RemoveMatchArm {
symbol_id: String,
enum_name: String,
pattern: String,
},
ReplaceMatchArm {
symbol_id: String,
enum_name: String,
old_pattern: String,
new_pattern: String,
new_body: String,
},
AddStructLiteralField {
struct_name: String,
field_name: String,
value: String,
},
AddConst {
symbol_id: String,
name: String,
ty: String,
value: String,
is_pub: bool,
},
RemoveConst {
symbol_id: String,
},
AddTypeAlias {
symbol_id: String,
name: String,
ty: String,
is_pub: bool,
},
RemoveTypeAlias {
symbol_id: String,
},
RemoveTrait {
name: String,
},
AddImpl {
symbol_id: String,
target: String,
trait_name: Option<String>,
},
RemoveImpl {
symbol_id: String,
},
AddItem {
symbol_id: String,
content: String,
},
RemoveItem {
symbol_id: String,
item_kind: String,
},
Generic {
mutation_type: String,
description: String,
},
}Expand description
Serializable representation of any mutation.
This enum captures all data needed to reconstruct and replay a mutation. Currently supports basic mutations; complex mutations store description only.
Variants§
Rename
Rename a symbol NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
ChangeVisibility
Change visibility of an item NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddFunction
Add a function NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
Fields
RemoveFunction
Remove a function NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddStruct
Add a struct
RemoveStruct
Remove a struct
AddField
Add a field to a struct
RemoveField
Remove a field from a struct
AddUse
Add a use statement
RemoveUse
Remove a use statement
AddDerive
Add derive macros NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveDerive
Remove derive macros NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddEnum
Add an enum NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveEnum
Remove an enum NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddVariant
Add a variant to an enum (unit variant only)
RemoveVariant
Remove a variant from an enum
AddMatchArm
Add a match arm to a function’s match expression NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveMatchArm
Remove a match arm from a function’s match expression NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
ReplaceMatchArm
Replace a match arm (pattern + body) in a function’s match expression NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddStructLiteralField
Add a field to all struct literals of a given type
AddConst
Add a const NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveConst
Remove a const NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddTypeAlias
Add a type alias NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveTypeAlias
Remove a type alias NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveTrait
Remove a trait
AddImpl
Add an impl block NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveImpl
Remove an impl block NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
AddItem
Add an item from raw source code content NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
RemoveItem
Remove an item by SymbolId NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)
Generic
Generic mutation that stores description only Used for complex mutations that can’t be easily serialized
Implementations§
Source§impl SerializableMutation
impl SerializableMutation
Sourcepub fn mutation_type(&self) -> &str
pub fn mutation_type(&self) -> &str
Get the mutation type name.
Sourcepub fn to_mutation(&self) -> Option<Box<dyn Mutation>>
pub fn to_mutation(&self) -> Option<Box<dyn Mutation>>
Convert to a boxed Mutation trait object.
Returns None for Generic variants or unsupported mutations.
Trait Implementations§
Source§impl Clone for SerializableMutation
impl Clone for SerializableMutation
Source§fn clone(&self) -> SerializableMutation
fn clone(&self) -> SerializableMutation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more