pub struct HotspotFinding {
pub entry: HotspotEntry,
pub actions: Vec<HotspotAction>,
}Expand description
Wire envelope for a single hotspot entry.
Flattens HotspotEntry for wire continuity and adds the typed
actions list. The #[serde(flatten)] keeps each hotspots[] item
byte-identical to the pre-wrapper shape: inner fields (path,
score, commits, weighted_commits, …) sit at the top level
alongside actions. Optional inner fields (ownership,
is_test_path) keep their original skip_serializing_if behaviour
because serde applies the flatten before the parent serializer runs.
Construct via HotspotFinding::with_actions in the typical health
pipeline (the typed action builder operates on the inner
HotspotEntry) or via HotspotFinding::from for fixture and
test code.
Fields§
§entry: HotspotEntryInner hotspot payload. Flattened on the wire.
actions: Vec<HotspotAction>Machine-actionable refactor and review hints. Always populated;
the list never empties because the action selector unconditionally
emits refactor-file plus add-tests. Ownership-derived variants
(low-bus-factor, unowned-hotspot, ownership-drift) are
appended when --ownership is active and the corresponding signal
fires.
Implementations§
Source§impl HotspotFinding
impl HotspotFinding
Sourcepub fn with_actions(entry: HotspotEntry, root: &Path) -> Self
pub fn with_actions(entry: HotspotEntry, root: &Path) -> Self
Construct a wrapper with the actions list computed from the
hotspot’s measured signals plus its ownership block (when
present).
root is the project root used to strip the absolute
HotspotEntry::path when composing action descriptions like
"Refactor {path}, ...".
The JSON post-pass that this wrapper retires ran AFTER
strip_root_prefix, so the typed builder must apply the same
stripping here for byte-identical wire output.
Trait Implementations§
Source§impl Clone for HotspotFinding
impl Clone for HotspotFinding
Source§impl Debug for HotspotFinding
impl Debug for HotspotFinding
Source§impl Deref for HotspotFinding
impl Deref for HotspotFinding
Source§impl<'de> Deserialize<'de> for HotspotFinding
impl<'de> Deserialize<'de> for HotspotFinding
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<HotspotEntry> for HotspotFinding
impl From<HotspotEntry> for HotspotFinding
Source§fn from(entry: HotspotEntry) -> Self
fn from(entry: HotspotEntry) -> Self
Convenience conversion: wrap a hotspot entry with an empty
actions list. Used by tests and fixture builders. Production
code should call HotspotFinding::with_actions so the wire
shape carries the typed actions.