pub struct Diagnostic {
pub source: String,
pub code: String,
pub severity: String,
pub path: Vec<Value>,
pub message: String,
}Expand description
A single structured validation failure.
Diagnostics are data, not formatted strings: map code to UI behavior,
path to the offending node (as JSON-pointer-like segments), and message
to a user-facing message. All diagnostics produced by this crate have
severity == "error" in v0.1.
source names the layer that rejected the input: "wdf" for the model
and validator, "markdown", "prosemirror" or "apple" for an adapter.
Fields§
§source: StringLayer that produced the failure: wdf, markdown, prosemirror, apple.
code: StringStable machine-readable code, e.g. wdf.unsupported_mark.
severity: StringAlways "error" in v0.1.
path: Vec<Value>JSON-pointer-like path to the offending value; may be empty.
message: StringHuman-readable explanation.
Implementations§
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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