use crate::{AnyOutput, ChainProcess, ProgramCollect, Routable}; /// Used to mark a type with a unique enum ID, assisting dynamic dispatch /// /// **Note:** Unlike earlier versions, `Grouped` no longer requires `Serialize` /// even when the `structural_renderer` feature is enabled. Structured output is /// controlled separately via the \[`StructuralData`\] trait. pub trait Grouped where Self: Sized + 'static, { /// Returns the specific enum value representing its ID within that enum fn member_id() -> Group; } impl Routable for T where C: ProgramCollect, T: Grouped + Send, { fn to_chain(self) -> ChainProcess { AnyOutput::new(self).route_chain() } fn to_render(self) -> ChainProcess { AnyOutput::new(self).route_renderer() } }