Skip to main content

Crate duck_diagnostic

Crate duck_diagnostic 

Source
Expand description

Generic diagnostic engine for tools that need rich, rustc-style error output. Plug in your own error code enum, attach spans + labels + suggestions, and render in pretty (color), plain, or JSON modes.

See examples/ for end-to-end demos.

Macros§

diag
Shorthand for Diagnostic::new(...) with optional label/note/help/suggestion.

Structs§

Diagnostic
DiagnosticEngine
DiagnosticFormatter
Label
RenderOptions
Tunables for rendered output.
SourceCache
Pre-split source cache. Build once per source string, reuse for many diagnostics.
Span
Source span.
Suggestion
Code rewrite suggestion attached to a diagnostic.

Enums§

Applicability
How confident the suggestion is — controls whether IDEs may auto-apply it.
LabelStyle
Severity
Severity of a diagnostic.

Traits§

DiagnosticCode
Implement this on your error enum to plug into the diagnostic system.