paralegal_policy::diagnostics

Trait Diagnostics

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§