Expand description
Framework-neutral diagnostics and optional rendering bridges.
Framework-neutral structured diagnostics and optional miette bridges.
Diagnostic is the canonical machine-readable representation used by
terminal renderers, editor protocols, and service integrations. Optional
adapters translate that payload into ecosystem-specific formats instead of
maintaining separate error-code, help, and label tables.
§Examples
use noyalib::{DiagnosticCode, Value, from_str};
let err = from_str::<Value>("key: [unclosed").unwrap_err();
let diagnostic = err.diagnostic();
assert_eq!(diagnostic.code(), DiagnosticCode::Parse);
assert!(!diagnostic.labels().is_empty());Structs§
- Diagnostic
- Framework-neutral diagnostic payload derived from an error or validator.
- Diagnostic
Label - A message attached to one source span.
- Source
Span - A half-open byte range in the original UTF-8 source.
Enums§
- Diagnostic
Code - Stable machine-readable code for a noyalib diagnostic.
- Diagnostic
Severity - Protocol-neutral diagnostic severity.
Functions§
- spanned_
error - Create a [
miette::Report] pointing at the source span of aSpanned<T>value. - spanned_
error_ with_ context - Create a [
miette::Report] pointing at a primary span with additional context from a secondary span.