#[cfg(feature = "general_renderer")] pub use general_renderer_groupped::*; #[cfg(not(feature = "general_renderer"))] pub use groupped::*; #[cfg(feature = "general_renderer")] mod general_renderer_groupped { use serde::Serialize; use crate::{AnyOutput, ChainProcess}; /// Used to mark a type with a unique enum ID, assisting dynamic dispatch pub trait Groupped where Self: Sized + Serialize + 'static, { /// Returns the specific enum value representing its ID within that enum fn member_id() -> Group; /// Converts the grouped item into a `ChainProcess` directed to the chain route. /// /// This wraps the item into an `AnyOutput` and routes it to the chain processing pipeline. fn to_chain(self) -> ChainProcess where Self: Send + Serialize, { AnyOutput::new(self).route_chain() } /// Converts the grouped item into a `ChainProcess` directed to the render route. /// /// This wraps the item into an `AnyOutput` and routes it to the render processing pipeline. fn to_render(self) -> ChainProcess where Self: Send + Serialize, { AnyOutput::new(self).route_renderer() } } } #[cfg(not(feature = "general_renderer"))] mod groupped { use crate::{AnyOutput, ChainProcess}; /// Used to mark a type with a unique enum ID, assisting dynamic dispatch pub trait Groupped where Self: Sized + 'static, { /// Returns the specific enum value representing its ID within that enum fn member_id() -> Group; /// Converts the grouped item into a `ChainProcess` directed to the chain route. /// /// This wraps the item into an `AnyOutput` and routes it to the chain processing pipeline. fn to_chain(self) -> ChainProcess where Self: Send, { AnyOutput::new(self).route_chain() } /// Converts the grouped item into a `ChainProcess` directed to the render route. /// /// This wraps the item into an `AnyOutput` and routes it to the render processing pipeline. fn to_render(self) -> ChainProcess where Self: Send, { AnyOutput::new(self).route_renderer() } } }