From b6876f9df6e3119331fac01c0bc954ca9f3c798b Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 5 Apr 2026 20:33:57 +0800 Subject: Add general renderer support with serialization formats --- mingling_core/src/program.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mingling_core/src/program.rs') diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index 5d81234..0a24001 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "general_renderer")] +use crate::error::GeneralRendererSerializeError; use crate::{ AnyOutput, ChainProcess, RenderResult, asset::dispatcher::Dispatcher, error::ProgramExecuteError, @@ -31,6 +33,9 @@ where pub stdout_setting: ProgramStdoutSetting, pub user_context: ProgramUserContext, + + #[cfg(feature = "general_renderer")] + pub general_renderer_name: GeneralRendererSetting, } impl Program @@ -47,6 +52,9 @@ where dispatcher: Vec::new(), stdout_setting: Default::default(), user_context: Default::default(), + + #[cfg(feature = "general_renderer")] + general_renderer_name: GeneralRendererSetting::Disable, } } @@ -115,6 +123,13 @@ pub trait ProgramCollect { /// Whether the program has a chain that can handle the current [AnyOutput](./struct.AnyOutput.html) fn has_chain(any: &AnyOutput) -> bool; + + /// Perform general rendering and presentation of any type + #[cfg(feature = "general_renderer")] + fn general_render( + any: AnyOutput, + setting: &GeneralRendererSetting, + ) -> Result; } #[macro_export] -- cgit