pub use dfir_macro::DemuxEnum;
#[diagnostic::on_unimplemented(
note = "ensure there is exactly one output for each enum variant.",
note = "ensure that the type for each output is a tuple of the field for the variant: `()`, `(a,)`, or `(a, b, ...)`."
)]
pub trait DemuxEnum<Outputs>: DemuxEnumBase {
fn demux_enum(self, outputs: &mut Outputs);
}
#[diagnostic::on_unimplemented(
note = "requires that the enum have only one variant.",
note = "ensure there are no missing outputs; there must be exactly one output for each enum variant."
)]
pub trait SingleVariant: DemuxEnumBase {
type Output;
fn single_variant(self) -> Self::Output;
}
#[diagnostic::on_unimplemented(note = "use `#[derive(dfir_rs::DemuxEnum)]`")]
pub trait DemuxEnumBase {}