Module diagnostics

Source

Modules§

miette
You run miette? You run her code like the software? Oh. Oh! Error code for coder! Error code for One Thousand Lines!
reporting
Rendering and error reporting implementation details.

Structs§

AdHocDiagnostic
Diagnostic that can be created at runtime.
ByteIndex
An index representing the offset in bytes from the start of a source file
ByteOffset
An offset in bytes relative to some ByteIndex
CaptureEmitter
CaptureEmitter is used to capture diagnostics which are emitted, for later examination.
ColumnIndex
A zero-indexed column number
DefaultEmitter
DefaultEmitter is used for rendering to stderr, and as is implied by the name, is the default emitter implementation.
DefaultSourceManager
DiagnosticError
Convenience [Diagnostic] that can be used as an “anonymous” wrapper for Errors. This is intended to be paired with IntoDiagnostic.
DiagnosticsConfig
DiagnosticsHandler
FileLineCol
A FileLineCol represents traditional file/line/column information for use in rendering.
InFlightDiagnosticBuilder
Constructs an in-flight diagnostic using the builder pattern
Label
Represents a diagnostic label.
LabeledSpan
A labeled SourceSpan.
LineIndex
A zero-indexed line number
Location
A Location represents file and span information for portability across source managers
NullEmitter
NullEmitter is used to silence diagnostics entirely, without changing anything in the diagnostic infrastructure.
PrintDiagnostic
A type that can be used to render a super::Diagnostic via core::fmt::Display
RelatedError
This type allows rolling up a diagnostic into a parent error
RelatedLabel
This type is used to associate a more complex label or set of labels with some other error.
Report
Core Diagnostic wrapper type.
SourceContent
Represents key information about a source file and its content:
SourceFile
A SourceFile represents a single file stored in a super::SourceManager
SourceFileRef
A reference to a specific spanned region of a SourceFile, that provides access to the actual SourceFile, but scoped to the span it was created with.
SourceId
A SourceId represents the index/identifier associated with a unique source file in a SourceManager implementation.
SourceSpan
This represents a span of bytes in a Miden Assembly source file.
Span
This type is used to wrap any T with a SourceSpan, and is typically used when it is not convenient to add a SourceSpan to the type - most commonly because we don’t control the type.

Enums§

Severity
Diagnostic severity. Intended to be used by ReportHandlers to change the way different Diagnostics are displayed. Defaults to Severity::Error.

Traits§

Diagnostic
Adds rich metadata to your Error that can be used by Report to print really nice and human-friendly error messages.
Emitter
The Emitter trait is used for controlling how diagnostics are displayed.
IntoDiagnostic
Convenience trait that adds a .into_diagnostic() method that converts a type implementing std::error::Error to a Result<T, Report>.
SourceManager
SourceManagerExt
Spanned
This trait should be implemented for any type that has an associated SourceSpan.
WrapErr
Provides the wrap_err() method for Result.

Type Aliases§

ReportHandlerOpts

Derive Macros§

Diagnostic
Spanned