pub struct FailureDiagnostic {
pub title: String,
pub source: DiagnosticSource,
pub confidence: DiagnosticConfidence,
pub reason: String,
pub cause: FailureCause,
pub fallback: Option<String>,
pub tried: Vec<String>,
pub actions: Vec<DiagnosticAction>,
pub commands: Vec<String>,
pub records: Vec<DiagnosticRecord>,
}Expand description
Actionable diagnostic document for failed or low-confidence pages.
Fields§
§title: StringDiagnostic title.
source: DiagnosticSourceBoundary that produced the diagnostic.
confidence: DiagnosticConfidenceConfidence level.
reason: StringShort user-facing reason.
cause: FailureCauseLikely cause classification.
fallback: Option<String>Fallback that was attempted or selected.
tried: Vec<String>Steps or boundaries Index tried before failing.
actions: Vec<DiagnosticAction>Suggested next actions.
commands: Vec<String>Exact suggested commands.
records: Vec<DiagnosticRecord>Structured diagnostic records.
Implementations§
Source§impl FailureDiagnostic
impl FailureDiagnostic
Sourcepub fn new(
title: impl Into<String>,
source: DiagnosticSource,
confidence: DiagnosticConfidence,
reason: impl Into<String>,
) -> Self
pub fn new( title: impl Into<String>, source: DiagnosticSource, confidence: DiagnosticConfidence, reason: impl Into<String>, ) -> Self
Creates an actionable diagnostic.
Sourcepub fn with_likely_cause(self, cause: FailureCause) -> Self
pub fn with_likely_cause(self, cause: FailureCause) -> Self
Overrides the likely cause classification.
Sourcepub fn with_fallback(self, fallback: impl Into<String>) -> Self
pub fn with_fallback(self, fallback: impl Into<String>) -> Self
Adds fallback information.
Sourcepub fn with_tried(self, tried: impl Into<String>) -> Self
pub fn with_tried(self, tried: impl Into<String>) -> Self
Adds a deterministic “what Index tried” entry.
Sourcepub fn with_actions(
self,
actions: impl IntoIterator<Item = DiagnosticAction>,
) -> Self
pub fn with_actions( self, actions: impl IntoIterator<Item = DiagnosticAction>, ) -> Self
Adds suggested next actions.
Sourcepub fn with_command(self, command: impl Into<String>) -> Self
pub fn with_command(self, command: impl Into<String>) -> Self
Adds one exact suggested command.
Sourcepub fn with_record(self, record: DiagnosticRecord) -> Self
pub fn with_record(self, record: DiagnosticRecord) -> Self
Adds one structured diagnostic record.
Sourcepub fn redacted(&self, redactor: &Redactor) -> Self
pub fn redacted(&self, redactor: &Redactor) -> Self
Returns a redacted copy suitable for logs and fixture submissions.
Sourcepub fn to_local_text(&self) -> String
pub fn to_local_text(&self) -> String
Formats deterministic local diagnostic text.
Sourcepub fn suggested_commands(&self) -> Vec<String>
pub fn suggested_commands(&self) -> Vec<String>
Returns exact suggested commands.
Sourcepub fn into_document(self) -> IndexDocument
pub fn into_document(self) -> IndexDocument
Converts the diagnostic into an Index document.
Trait Implementations§
Source§impl Clone for FailureDiagnostic
impl Clone for FailureDiagnostic
Source§fn clone(&self) -> FailureDiagnostic
fn clone(&self) -> FailureDiagnostic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FailureDiagnostic
impl Debug for FailureDiagnostic
Source§impl PartialEq for FailureDiagnostic
impl PartialEq for FailureDiagnostic
Source§fn eq(&self, other: &FailureDiagnostic) -> bool
fn eq(&self, other: &FailureDiagnostic) -> bool
self and other values to be equal, and is used by ==.