pub trait Diagnostics: HasDiagnosticsBase {
Show 24 methods // Provided methods fn struct_error( &self, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_span_error( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_warning( &self, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_span_warning( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self> { ... } fn struct_span_help( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self> { ... } fn struct_span_note( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn error(&self, msg: impl Into<String>) { ... } fn warning(&self, msg: impl Into<String>) { ... } fn note(&self, msg: impl Into<String>) { ... } fn help(&self, msg: impl Into<String>) { ... } fn span_error(&self, msg: impl Into<String>, span: Span) { ... } fn span_warning(&self, msg: impl Into<String>, span: Span) { ... } fn span_note(&self, msg: impl Into<String>, span: Span) { ... } fn span_help(&self, msg: impl Into<String>, span: Span) { ... } fn struct_node_error( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_node_warning( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_node_note( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn struct_node_help( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self> { ... } fn node_error(&self, node: GlobalNode, msg: impl Into<String>) { ... } fn node_warning(&self, node: GlobalNode, msg: impl Into<String>) { ... } fn node_note(&self, node: GlobalNode, msg: impl Into<String>) { ... } fn node_help(&self, node: GlobalNode, msg: impl Into<String>) { ... }
}
Expand description

User-facing methods to emit diagnostics.

This is how any types implementing HasDiagnosticsBase should actually be used.

Provided Methods§

source

fn struct_error(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an error.

This will fail the policy.

source

fn struct_span_error( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an error with a source code span.

This will fail the policy.

source

fn struct_warning(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a warning.

Does not fail the policy.

source

fn struct_span_warning( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a warning with a source code span

Does not fail the policy.

source

fn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a help message.

source

fn struct_span_help( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a help message with a source code span

source

fn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a note

source

fn struct_span_note( &self, span: impl Into<HighlightedSpan>, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for a note with a source code span

source

fn error(&self, msg: impl Into<String>)

Emit a message that is severe enough that it causes the policy to fail.

source

fn warning(&self, msg: impl Into<String>)

Emit a message that indicates to the user that the policy might be fraudulent but could be correct.

source

fn note(&self, msg: impl Into<String>)

Emit a message that provides additional information to the user.

source

fn help(&self, msg: impl Into<String>)

Emit a message that suggests something to the user.

source

fn span_error(&self, msg: impl Into<String>, span: Span)

Emit a message that is severe enough that it causes the policy to fail with a source code span.

source

fn span_warning(&self, msg: impl Into<String>, span: Span)

Emit a message that indicates to the user that the policy might be fraudulent but could be correct. Includes a source code span.

source

fn span_note(&self, msg: impl Into<String>, span: Span)

Emit a message that provides additional information to the user.

source

fn span_help(&self, msg: impl Into<String>, span: Span)

Emit a message that suggests something to the user.

source

fn struct_node_error( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an error with the span of a graph node.

This will fail the policy.

source

fn struct_node_warning( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an error with the span of a graph node.

This will not fail the policy.

source

fn struct_node_note( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an note with the span of a graph node.

source

fn struct_node_help( &self, node: GlobalNode, msg: impl Into<String> ) -> DiagnosticBuilder<'_, Self>

Initialize a diagnostic builder for an help message with the span of a graph node.

source

fn node_error(&self, node: GlobalNode, msg: impl Into<String>)

Emit an error, failing the policy, with the span of a graph node.

source

fn node_warning(&self, node: GlobalNode, msg: impl Into<String>)

Emit an warning, that does not fail the policy, with the span of a graph node.

source

fn node_note(&self, node: GlobalNode, msg: impl Into<String>)

Emit a note with the span of a graph node.

source

fn node_help(&self, node: GlobalNode, msg: impl Into<String>)

Emit a help message with the span of a graph node.

Implementors§