pub struct StructuredDiagnostic {
pub code: DiagnosticCode,
pub severity: DiagnosticSeverity,
pub stage: DiagnosticStage,
pub message: String,
pub element_path: Option<String>,
pub source_ref: Option<SourceRef>,
pub details: Map<String, Value>,
pub suggested_action: Option<String>,
pub safe_to_ignore: Vec<String>,
}Expand description
One structured finding.
Fields§
§code: DiagnosticCode§severity: DiagnosticSeverity§stage: DiagnosticStage§message: String§element_path: Option<String>JSON pointer (or best-effort locator) of the element the finding is about.
source_ref: Option<SourceRef>§details: Map<String, Value>Code-specific structured payload, e.g. {"dropped_fields": ["angmin"]}.
suggested_action: Option<String>§safe_to_ignore: Vec<String>Workflows for which this finding is safe to ignore, e.g.
["power_flow", "opf"]. Empty means “no such assurance”.
Implementations§
Source§impl StructuredDiagnostic
impl StructuredDiagnostic
Sourcepub fn new(
code: impl Into<DiagnosticCode>,
severity: DiagnosticSeverity,
stage: DiagnosticStage,
message: impl Into<String>,
) -> Self
pub fn new( code: impl Into<DiagnosticCode>, severity: DiagnosticSeverity, stage: DiagnosticStage, message: impl Into<String>, ) -> Self
A minimal finding; fill the optional locators with the builder methods.
pub fn with_element_path(self, path: impl Into<String>) -> Self
pub fn with_source_ref(self, source_ref: SourceRef) -> Self
pub fn with_suggested_action(self, action: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for StructuredDiagnostic
impl Clone for StructuredDiagnostic
Source§fn clone(&self) -> StructuredDiagnostic
fn clone(&self) -> StructuredDiagnostic
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 StructuredDiagnostic
impl Debug for StructuredDiagnostic
Source§impl<'de> Deserialize<'de> for StructuredDiagnostic
impl<'de> Deserialize<'de> for StructuredDiagnostic
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
Source§impl PartialEq for StructuredDiagnostic
impl PartialEq for StructuredDiagnostic
Source§impl Serialize for StructuredDiagnostic
impl Serialize for StructuredDiagnostic
impl StructuralPartialEq for StructuredDiagnostic
Auto Trait Implementations§
impl Freeze for StructuredDiagnostic
impl RefUnwindSafe for StructuredDiagnostic
impl Send for StructuredDiagnostic
impl Sync for StructuredDiagnostic
impl Unpin for StructuredDiagnostic
impl UnsafeUnpin for StructuredDiagnostic
impl UnwindSafe for StructuredDiagnostic
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