Expand description
Types and implementations for marking spans. Diagnostic construction utilities.
The mark module provides free functions returning a [Builder],
which accumulates diagnostics and is finalized into an immutable Diagnostic
via [Builder::build].
§Quick start
ⓘ
// Single error
return Err(mark::error("field `name` is required").build());
// Accumulator
let d = mark::new()
.add(mark::error("missing `x`"))
.add(mark::help("add `x: u32` to your struct"))
.build();
if d.is_error() { return d.emit(); }Structs§
- Builder
- Builder for constructing
Diagnosticinstances. - Diagnostic
- A compiler diagnostic (error, warning, note, or help message).
- Walk
Enums§
- Level
- Diagnostic severity level, ordered from least to most severe.
Traits§
Functions§
- error
- Creates an error diagnostic builder with the given message.
- help
- Creates a help diagnostic builder with the given message.
- new
- Creates an empty diagnostic builder.
- note
- Creates a note diagnostic builder with the given message.
- warning
- Creates a warning diagnostic builder with the given message.