Skip to main content

FixStrategyEntry

Struct FixStrategyEntry 

Source
pub struct FixStrategyEntry {
Show 24 fields pub strategy: String, pub from: Option<String>, pub to: Option<String>, pub component: Option<String>, pub prop: Option<String>, pub mappings: Vec<MappingEntry>, pub member_mappings: Vec<MemberMappingEntry>, pub removed_members: Vec<String>, pub replacement: Option<String>, pub overlap_ratio: Option<f64>, pub package: Option<String>, pub new_version: Option<String>, pub target_structure: Option<String>, pub retained_props: Vec<String>, pub prop_to_child: BTreeMap<String, String>, pub unmapped_removed_props: BTreeMap<String, String>, pub removed_children: Vec<String>, pub child_props_to_parent: BTreeMap<String, String>, pub prop_value_changes: BTreeMap<String, Vec<MappingEntry>>, pub new_imports: Vec<String>, pub removed_imports: Vec<String>, pub import_source: Option<String>, pub deprecated_migration: Option<DeprecatedMigrationContext>, pub exclude_patterns: Vec<String>,
}
Expand description

A machine-readable fix strategy entry.

For non-consolidated rules, from/to hold the single mapping. For consolidated rules, mappings holds all individual mappings from the merged rules, allowing the fix engine to apply all renames/removals. For structural migration rules, member_mappings and removed_members describe the member-level overlap between removed and replacement interfaces.

Fields§

§strategy: String§from: Option<String>§to: Option<String>§component: Option<String>§prop: Option<String>§mappings: Vec<MappingEntry>

All individual mappings when this strategy was merged from multiple rules.

§member_mappings: Vec<MemberMappingEntry>

Structural migration: matching member mappings between removed and replacement.

§removed_members: Vec<String>

Structural migration: member names only in the removed interface (no match).

§replacement: Option<String>

Structural migration: the replacement symbol name.

§overlap_ratio: Option<f64>

Structural migration: overlap ratio between removed and replacement.

§package: Option<String>

Dependency update: npm package name (e.g., “@patternfly/react-core”).

§new_version: Option<String>

Dependency update: new version range (e.g., “^6.1.0”).

§target_structure: Option<String>

Target JSX structure template showing correct composition. Example: <Modal ...>\n <ModalHeader .../>\n <ModalBody>...</ModalBody>\n</Modal>

§retained_props: Vec<String>

Props that remain on the root component in the new version.

§prop_to_child: BTreeMap<String, String>

Map of removed prop name → child component that now owns it (as a named prop).

§unmapped_removed_props: BTreeMap<String, String>

Props removed from the root that don’t have an exact prop-name match on any child component. Maps prop name → description of where/how to migrate (e.g., “ModalFooter (as children)”). Unlike prop_to_child, these props typically become children of the target component or are removed entirely.

§removed_children: Vec<String>

Child component names removed from the family (flattened into parent).

§child_props_to_parent: BTreeMap<String, String>

Map of “Child.prop” → “Parent.prop” for child-to-prop migrations.

§prop_value_changes: BTreeMap<String, Vec<MappingEntry>>

Prop value changes: prop_name → list of old→new value mappings.

§new_imports: Vec<String>

New imports needed after restructuring (child components to add).

§removed_imports: Vec<String>

Imports to remove after restructuring (removed child components).

§import_source: Option<String>

Import source package (e.g., “@patternfly/react-core”).

§deprecated_migration: Option<DeprecatedMigrationContext>

Deprecated → v6 migration context with prop mappings, types, and new/removed prop lists. Present when the family includes a deprecated component that has a detected migration target.

§exclude_patterns: Vec<String>

Patterns to exclude from this fix strategy’s automated replacement.

Used with CssVariablePrefix to prevent blind prefix swaps on CSS classes that were removed in the target version. When the matched text contains any of these patterns, the edit is skipped. The incident is still reported (as Manual) by a separate dead-class rule.

Implementations§

Source§

impl FixStrategyEntry

Source

pub fn new(strategy: &str) -> FixStrategyEntry

Create a new strategy entry with only the strategy type set.

Source

pub fn rename( from: impl Into<String>, to: impl Into<String>, ) -> FixStrategyEntry

Create a Rename strategy with a single from/to pair.

Source

pub fn with_from_to( strategy: &str, from: impl Into<String>, to: impl Into<String>, ) -> FixStrategyEntry

Create a strategy with from/to and a named strategy type.

Source

pub fn remove_prop( component: impl Into<String>, prop: impl Into<String>, ) -> FixStrategyEntry

Create a RemoveProp strategy.

Source

pub fn structural_migration( removed_symbol: &str, replacement_symbol: &str, member_mappings: Vec<MemberMappingEntry>, removed_members: Vec<String>, overlap_ratio: f64, ) -> FixStrategyEntry

Create an LlmAssisted strategy enriched with structural migration data.

Source

pub fn ensure_dependency( package: impl Into<String>, new_version: impl Into<String>, ) -> FixStrategyEntry

Create an EnsureDependency strategy: add if missing, update version if present.

Source

pub fn to_mapping(&self) -> MappingEntry

Convert to a MappingEntry (extracting the single mapping).

Trait Implementations§

Source§

impl Clone for FixStrategyEntry

Source§

fn clone(&self) -> FixStrategyEntry

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 FixStrategyEntry

Source§

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

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

impl Default for FixStrategyEntry

Source§

fn default() -> FixStrategyEntry

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FixStrategyEntry

Source§

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

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

impl Serialize for FixStrategyEntry

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.