pub struct HealingDiagnosis {
pub diagnosis: String,
pub suggested_selector: String,
pub confidence: f64,
pub alternatives: Vec<String>,
pub issue_type: Option<SelectorIssueType>,
}Expand description
Diagnosis and suggested fix from the LLM.
Fields§
§diagnosis: StringExplanation of why the selector failed.
suggested_selector: StringSuggested working selector.
confidence: f64Confidence in the suggestion (0.0 to 1.0).
alternatives: Vec<String>Alternative selectors to try if the first fails.
issue_type: Option<SelectorIssueType>Type of issue identified.
Implementations§
Source§impl HealingDiagnosis
impl HealingDiagnosis
Sourcepub fn new(
diagnosis: impl Into<String>,
suggested_selector: impl Into<String>,
confidence: f64,
) -> Self
pub fn new( diagnosis: impl Into<String>, suggested_selector: impl Into<String>, confidence: f64, ) -> Self
Create a new diagnosis.
Sourcepub fn with_alternatives(self, alts: Vec<String>) -> Self
pub fn with_alternatives(self, alts: Vec<String>) -> Self
Add alternative selectors.
Sourcepub fn with_issue_type(self, issue: SelectorIssueType) -> Self
pub fn with_issue_type(self, issue: SelectorIssueType) -> Self
Set issue type.
Sourcepub fn is_confident(&self, min_confidence: f64) -> bool
pub fn is_confident(&self, min_confidence: f64) -> bool
Check if the suggestion meets minimum confidence.
Sourcepub fn all_selectors(&self) -> Vec<&str>
pub fn all_selectors(&self) -> Vec<&str>
Get all selectors to try (suggested + alternatives).
Trait Implementations§
Source§impl Clone for HealingDiagnosis
impl Clone for HealingDiagnosis
Source§fn clone(&self) -> HealingDiagnosis
fn clone(&self) -> HealingDiagnosis
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealingDiagnosis
impl Debug for HealingDiagnosis
Source§impl<'de> Deserialize<'de> for HealingDiagnosis
impl<'de> Deserialize<'de> for HealingDiagnosis
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HealingDiagnosis
impl RefUnwindSafe for HealingDiagnosis
impl Send for HealingDiagnosis
impl Sync for HealingDiagnosis
impl Unpin for HealingDiagnosis
impl UnsafeUnpin for HealingDiagnosis
impl UnwindSafe for HealingDiagnosis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more