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§
Sourcefn struct_error(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_error(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Initialize a diagnostic builder for an error.
This will fail the policy.
Sourcefn struct_span_error(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn struct_warning(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_warning(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Initialize a diagnostic builder for a warning.
Does not fail the policy.
Sourcefn struct_span_warning(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_help(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Initialize a diagnostic builder for a help message.
Sourcefn struct_span_help(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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
Sourcefn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
fn struct_note(&self, msg: impl Into<String>) -> DiagnosticBuilder<'_, Self>
Initialize a diagnostic builder for a note
Sourcefn struct_span_note(
&self,
span: impl Into<HighlightedSpan>,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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
Sourcefn error(&self, msg: impl Into<String>)
fn error(&self, msg: impl Into<String>)
Emit a message that is severe enough that it causes the policy to fail.
Sourcefn warning(&self, msg: impl Into<String>)
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.
Sourcefn note(&self, msg: impl Into<String>)
fn note(&self, msg: impl Into<String>)
Emit a message that provides additional information to the user.
Sourcefn span_error(&self, msg: impl Into<String>, span: Span)
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.
Sourcefn span_warning(&self, msg: impl Into<String>, span: Span)
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.
Sourcefn span_note(&self, msg: impl Into<String>, span: Span)
fn span_note(&self, msg: impl Into<String>, span: Span)
Emit a message that provides additional information to the user.
Sourcefn span_help(&self, msg: impl Into<String>, span: Span)
fn span_help(&self, msg: impl Into<String>, span: Span)
Emit a message that suggests something to the user.
Sourcefn struct_node_error(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn struct_node_warning(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn struct_node_note(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn struct_node_help(
&self,
node: GlobalNode,
msg: impl Into<String>,
) -> DiagnosticBuilder<'_, Self>
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.
Sourcefn node_error(&self, node: GlobalNode, msg: impl Into<String>)
fn node_error(&self, node: GlobalNode, msg: impl Into<String>)
Emit an error, failing the policy, with the span of a graph node.
Sourcefn node_warning(&self, node: GlobalNode, msg: impl Into<String>)
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.
Sourcefn node_note(&self, node: GlobalNode, msg: impl Into<String>)
fn node_note(&self, node: GlobalNode, msg: impl Into<String>)
Emit a note with the span of a graph node.
Sourcefn node_help(&self, node: GlobalNode, msg: impl Into<String>)
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.