pub trait EmissionGuarantee: Sized {
// Required methods
fn diagnostic_builder_emit_producing_guarantee(
db: &mut DiagnosticBuilder<'_, Self>
) -> Self;
fn make_diagnostic_builder(
handler: &Handler,
msg: impl Into<DiagnosticMessage>
) -> DiagnosticBuilder<'_, Self>;
}
Expand description
Trait for types that DiagnosticBuilder::emit
can return as a “guarantee”
(or “proof”) token that the emission happened.
Required Methods§
sourcefn diagnostic_builder_emit_producing_guarantee(
db: &mut DiagnosticBuilder<'_, Self>
) -> Self
fn diagnostic_builder_emit_producing_guarantee( db: &mut DiagnosticBuilder<'_, Self> ) -> Self
Implementation of DiagnosticBuilder::emit
, fully controlled by each
impl
of EmissionGuarantee
, to make it impossible to create a value
of Self
without actually performing the emission.
sourcefn make_diagnostic_builder(
handler: &Handler,
msg: impl Into<DiagnosticMessage>
) -> DiagnosticBuilder<'_, Self>
fn make_diagnostic_builder( handler: &Handler, msg: impl Into<DiagnosticMessage> ) -> DiagnosticBuilder<'_, Self>
Creates a new DiagnosticBuilder
that will return this type of guarantee.