pub struct RefactoringTargetFinding {
pub target: RefactoringTarget,
pub actions: Vec<RefactoringTargetAction>,
}Expand description
Wire envelope for a single refactoring target.
Flattens RefactoringTarget for wire continuity and adds the typed
actions list. The #[serde(flatten)] keeps each targets[] item
byte-identical to the pre-wrapper shape: inner fields (path,
priority, efficiency, recommendation, category, …) sit at
the top level alongside actions. Optional inner fields (factors,
evidence) keep their original skip_serializing_if behaviour.
Construct via RefactoringTargetFinding::with_actions in the
typical health pipeline or via RefactoringTargetFinding::from for
fixture and test code.
Fields§
§target: RefactoringTargetInner refactoring target payload. Flattened on the wire.
actions: Vec<RefactoringTargetAction>Machine-actionable refactoring and suppression hints. Always
populated; the list never empties because the action selector
unconditionally emits apply-refactoring. A trailing
suppress-line is appended only when the target carries
RefactoringTarget::evidence linking to specific functions.
Implementations§
Source§impl RefactoringTargetFinding
impl RefactoringTargetFinding
Sourcepub fn with_actions(target: RefactoringTarget) -> Self
pub fn with_actions(target: RefactoringTarget) -> Self
Construct a wrapper with the actions list computed from the
target’s recommendation, category, and optional evidence.
Asymmetry with HotspotFinding::with_actions: this constructor
does NOT take a root: &Path because refactoring-target action
descriptions never interpolate the file path; they pass
RefactoringTarget::recommendation verbatim into the
apply-refactoring action. The RefactoringTarget::category
field flows into the action’s category field as the serde
snake-case form.
Trait Implementations§
Source§impl Clone for RefactoringTargetFinding
impl Clone for RefactoringTargetFinding
Source§impl Debug for RefactoringTargetFinding
impl Debug for RefactoringTargetFinding
Source§impl Deref for RefactoringTargetFinding
impl Deref for RefactoringTargetFinding
Source§impl<'de> Deserialize<'de> for RefactoringTargetFinding
impl<'de> Deserialize<'de> for RefactoringTargetFinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<RefactoringTarget> for RefactoringTargetFinding
impl From<RefactoringTarget> for RefactoringTargetFinding
Source§fn from(target: RefactoringTarget) -> Self
fn from(target: RefactoringTarget) -> Self
Convenience conversion: wrap a refactoring target with an empty
actions list. Used by tests and fixture builders. Production
code should call RefactoringTargetFinding::with_actions so
the wire shape carries the typed actions.