diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-02-04 00:27:16 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-02-04 00:27:16 +0800 |
| commit | d19e5d84ee21502fd3440511d4ffb1ee1f49d3b2 (patch) | |
| tree | fb8efef6f8e9a26c5b60d4ac220b11d6c6f0775e /templates/_commands.rs.template | |
| parent | 7ee0d3f20c875e7405bb8442c5eb0228d1599a03 (diff) | |
Refactor build system and implement complete renderer system
- Split monolithic build.rs into modular async generators
- Add renderer override system with type-safe dispatch
- Implement command template macro for consistent command definitions
- Add proc-macro crates for command and renderer systems
- Reorganize directory structure for better separation of concerns
- Update documentation to reflect new architecture
Diffstat (limited to 'templates/_commands.rs.template')
| -rw-r--r-- | templates/_commands.rs.template | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/templates/_commands.rs.template b/templates/_commands.rs.template new file mode 100644 index 0000000..84d2db4 --- /dev/null +++ b/templates/_commands.rs.template @@ -0,0 +1,40 @@ +// Auto generated by build.rs +use crate::systems::cmd::cmd_system::{JVCommand, JVCommandContext}; +use crate::systems::cmd::errors::CmdProcessError; +<<LINE>> +/// Input parameters, execute a command node +pub async fn jv_cmd_process_node( + node: &str, + args: Vec<String>, + ctx: JVCommandContext, + renderer_override: String +) -> Result<crate::systems::render::renderer::JVRenderResult, crate::systems::cmd::errors::CmdProcessError> { + match node { +// PROCESS +// -- TEMPLATE START -- + // Command `<<KEY>>` + "<<NODE_NAME>>" => { + if renderer_override == "default" { + return crate::<<COMMAND_TYPE>>::process_to_render_system( + args, ctx, + ) + .await; + } else { + return crate::<<COMMAND_TYPE>>::process_to_renderer_override( + args, + ctx, + renderer_override, + ) + .await; + } + } +// -- TEMPLATE END -- + _ => {} + } + return Err(CmdProcessError::NoNodeFound(node.to_string())); +} +<<LINE>> +/// Get all command nodes +pub fn jv_cmd_nodes() -> Vec<String> { + vec!<<NODES>> +} |
