aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/any
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-20 00:17:21 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-20 00:17:21 +0800
commite1b8f6bc80c361070265484fcc442f7923523c1e (patch)
treec0cb7333f302634d308ee79d1512e0f9679b9ebb /mingling_core/src/any
parent4be889ac2dc5263ce03bb014de24916bee2e9aa8 (diff)
Move to_chain and to_render to Groupped trait
Diffstat (limited to 'mingling_core/src/any')
-rw-r--r--mingling_core/src/any/group.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/mingling_core/src/any/group.rs b/mingling_core/src/any/group.rs
index 04701f2..c251286 100644
--- a/mingling_core/src/any/group.rs
+++ b/mingling_core/src/any/group.rs
@@ -1,5 +1,21 @@
+use crate::{AnyOutput, ChainProcess};
+
/// Used to mark a type with a unique enum ID, assisting dynamic dispatch
pub trait Groupped<Group> {
/// 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<Group> {
+ 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<Group> {
+ AnyOutput::new(self).route_renderer()
+ }
}