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
impl FixStrategyEntry
Sourcepub fn new(strategy: &str) -> FixStrategyEntry
pub fn new(strategy: &str) -> FixStrategyEntry
Create a new strategy entry with only the strategy type set.
Sourcepub fn rename(
from: impl Into<String>,
to: impl Into<String>,
) -> FixStrategyEntry
pub fn rename( from: impl Into<String>, to: impl Into<String>, ) -> FixStrategyEntry
Create a Rename strategy with a single from/to pair.
Sourcepub fn with_from_to(
strategy: &str,
from: impl Into<String>,
to: impl Into<String>,
) -> FixStrategyEntry
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.
Sourcepub fn remove_prop(
component: impl Into<String>,
prop: impl Into<String>,
) -> FixStrategyEntry
pub fn remove_prop( component: impl Into<String>, prop: impl Into<String>, ) -> FixStrategyEntry
Create a RemoveProp strategy.
Sourcepub fn structural_migration(
removed_symbol: &str,
replacement_symbol: &str,
member_mappings: Vec<MemberMappingEntry>,
removed_members: Vec<String>,
overlap_ratio: f64,
) -> FixStrategyEntry
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.
Sourcepub fn ensure_dependency(
package: impl Into<String>,
new_version: impl Into<String>,
) -> FixStrategyEntry
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.
Sourcepub fn to_mapping(&self) -> MappingEntry
pub fn to_mapping(&self) -> MappingEntry
Convert to a MappingEntry (extracting the single mapping).
Trait Implementations§
Source§impl Clone for FixStrategyEntry
impl Clone for FixStrategyEntry
Source§fn clone(&self) -> FixStrategyEntry
fn clone(&self) -> FixStrategyEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more