Skip to main content

SerializableMutation

Enum SerializableMutation 

Source
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”)

Fields

§symbol_id: String
§

ChangeVisibility

Change visibility of an item NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§visibility: String
§

AddFunction

Add a function NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§name: String
§params: Vec<(String, String)>
§return_type: Option<String>
§body: String
§is_pub: bool
§

RemoveFunction

Remove a function NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§

AddStruct

Add a struct

Fields

§name: String
§fields: Vec<(String, String, bool)>
§is_pub: bool
§

RemoveStruct

Remove a struct

Fields

§name: String
§

AddField

Add a field to a struct

Fields

§struct_name: String
§field_name: String
§field_type: String
§is_pub: bool
§

RemoveField

Remove a field from a struct

Fields

§struct_name: String
§field_name: String
§

AddUse

Add a use statement

Fields

§path: String
§

RemoveUse

Remove a use statement

Fields

§path: String
§

AddDerive

Add derive macros NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§derives: Vec<String>
§

RemoveDerive

Remove derive macros NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§derives: Vec<String>
§

AddEnum

Add an enum NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§name: String
§variants: Vec<String>
§derives: Vec<String>
§is_pub: bool
§

RemoveEnum

Remove an enum NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§

AddVariant

Add a variant to an enum (unit variant only)

Fields

§enum_name: String
§variant_name: String
§

RemoveVariant

Remove a variant from an enum

Fields

§enum_name: String
§variant_name: String
§

AddMatchArm

Add a match arm to a function’s match expression NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§enum_name: String
§pattern: String
§body: String
§

RemoveMatchArm

Remove a match arm from a function’s match expression NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§enum_name: String
§pattern: String
§

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”)

Fields

§symbol_id: String
§enum_name: String
§old_pattern: String
§new_pattern: String
§new_body: String
§

AddStructLiteralField

Add a field to all struct literals of a given type

Fields

§struct_name: String
§field_name: String
§value: String
§

AddConst

Add a const NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§name: String
§value: String
§is_pub: bool
§

RemoveConst

Remove a const NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§

AddTypeAlias

Add a type alias NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§name: String
§is_pub: bool
§

RemoveTypeAlias

Remove a type alias NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§

RemoveTrait

Remove a trait

Fields

§name: String
§

AddImpl

Add an impl block NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§target: String
§trait_name: Option<String>
§

RemoveImpl

Remove an impl block NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§

AddItem

Add an item from raw source code content NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§content: String
§

RemoveItem

Remove an item by SymbolId NOTE: symbol_id is stored as string format “indexVversion” (e.g., “165v1”)

Fields

§symbol_id: String
§item_kind: String
§

Generic

Generic mutation that stores description only Used for complex mutations that can’t be easily serialized

Fields

§mutation_type: String
§description: String

Implementations§

Source§

impl SerializableMutation

Source

pub fn mutation_type(&self) -> &str

Get the mutation type name.

Source

pub fn to_mutation(&self) -> Option<Box<dyn Mutation>>

Convert to a boxed Mutation trait object.

Returns None for Generic variants or unsupported mutations.

Source

pub fn to_json(&self) -> Value

Convert to JSON Value for storage.

Source

pub fn from_json(value: &Value) -> Option<Self>

Parse from JSON Value.

Trait Implementations§

Source§

impl Clone for SerializableMutation

Source§

fn clone(&self) -> SerializableMutation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SerializableMutation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SerializableMutation

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SerializableMutation

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,