pub struct ValidationDiagnostic {
pub path: String,
pub severity: Severity,
pub code: DiagnosticCode,
pub message: String,
pub source_location: Option<SourceLocation>,
}Expand description
A single validation diagnostic (error, warning, or informational).
Each diagnostic describes a specific issue found during validation, with enough context for both human readers and programmatic consumers.
§Examples
use schemaorg_rs::validation::{ValidationDiagnostic, Severity, DiagnosticCode};
let diag = ValidationDiagnostic {
path: "Product.offers[0].price".into(),
severity: Severity::Error,
code: DiagnosticCode::InvalidValueType,
message: "Property 'price' expects Number or Text, got Person".into(),
source_location: None,
};
assert!(diag.severity == Severity::Error);Fields§
§path: StringJSON-path-like location in the structured data graph.
Examples: "Product", "Product.offers[0].price".
severity: SeveritySeverity level.
code: DiagnosticCodeMachine-readable diagnostic code.
message: StringHuman-readable message describing the issue.
source_location: Option<SourceLocation>Location in the original HTML, if available.
Trait Implementations§
Source§impl Clone for ValidationDiagnostic
impl Clone for ValidationDiagnostic
Source§fn clone(&self) -> ValidationDiagnostic
fn clone(&self) -> ValidationDiagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ValidationDiagnostic
impl Debug for ValidationDiagnostic
Source§impl<'de> Deserialize<'de> for ValidationDiagnostic
impl<'de> Deserialize<'de> for ValidationDiagnostic
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 ValidationDiagnostic
impl PartialEq for ValidationDiagnostic
Source§fn eq(&self, other: &ValidationDiagnostic) -> bool
fn eq(&self, other: &ValidationDiagnostic) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ValidationDiagnostic
impl Serialize for ValidationDiagnostic
impl StructuralPartialEq for ValidationDiagnostic
Auto Trait Implementations§
impl Freeze for ValidationDiagnostic
impl RefUnwindSafe for ValidationDiagnostic
impl Send for ValidationDiagnostic
impl Sync for ValidationDiagnostic
impl Unpin for ValidationDiagnostic
impl UnsafeUnpin for ValidationDiagnostic
impl UnwindSafe for ValidationDiagnostic
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