summaryrefslogtreecommitdiff
path: root/mingling_core/src/program.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-05 20:33:57 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-05 20:33:57 +0800
commitb6876f9df6e3119331fac01c0bc954ca9f3c798b (patch)
tree030301c8d434d51fa386e9a5fff77bce5899733b /mingling_core/src/program.rs
parentb41e201e554c4ba5ad6f1e09ce58dd3d10b6a635 (diff)
Add general renderer support with serialization formats
Diffstat (limited to 'mingling_core/src/program.rs')
-rw-r--r--mingling_core/src/program.rs15
1 files changed, 15 insertions, 0 deletions
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<C, G> Program<C, G>
@@ -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<Self::Enum>) -> bool;
+
+ /// Perform general rendering and presentation of any type
+ #[cfg(feature = "general_renderer")]
+ fn general_render(
+ any: AnyOutput<Self::Enum>,
+ setting: &GeneralRendererSetting,
+ ) -> Result<RenderResult, GeneralRendererSerializeError>;
}
#[macro_export]