pub trait EmissionGuarantee: Sized {
type EmitResult;
// Required method
fn emit_producing_guarantee(
db: &mut DiagBuilder<'_, Self>,
) -> Self::EmitResult;
}Expand description
Trait for types that DiagBuilder::emit can return as a “guarantee” (or “proof”) token
that the emission happened.
Required Associated Types§
Sourcetype EmitResult
type EmitResult
This exists so that bugs and fatal errors can both result in ! (an abort) when emitted,
but have different aborting behaviour.
Required Methods§
Sourcefn emit_producing_guarantee(db: &mut DiagBuilder<'_, Self>) -> Self::EmitResult
fn emit_producing_guarantee(db: &mut DiagBuilder<'_, Self>) -> Self::EmitResult
Implementation of DiagBuilder::emit, fully controlled by each impl of
EmissionGuarantee, to make it impossible to create a value of Self::EmitResult without
actually performing the emission.
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.