diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-15 22:57:36 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-15 22:57:36 +0800 |
| commit | 0a6b6c1d213e19c7649e343c2a77f3399feb8016 (patch) | |
| tree | 9c2e0fbf51a1f6e80f5a623ad094be2b62782607 /src/systems/cmd/cmd_system.rs | |
| parent | 71145f72947033bbc5125e14ea89f8d68c189da4 (diff) | |
Add build system rerun triggers and refactor command system
Diffstat (limited to 'src/systems/cmd/cmd_system.rs')
| -rw-r--r-- | src/systems/cmd/cmd_system.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/systems/cmd/cmd_system.rs b/src/systems/cmd/cmd_system.rs index 3ae4d5e..7272c9e 100644 --- a/src/systems/cmd/cmd_system.rs +++ b/src/systems/cmd/cmd_system.rs @@ -9,11 +9,13 @@ use crate::{ }, }; use std::{ - any::{Any, TypeId, type_name}, + any::{TypeId, type_name}, collections::HashMap, future::Future, }; +pub type AnyOutput = (Box<dyn std::any::Any + Send + 'static>, TypeId); + pub struct JVCommandContext { pub help: bool, pub confirmed: bool, @@ -93,8 +95,7 @@ where fn process( args: Vec<String>, ctx: JVCommandContext, - ) -> impl Future<Output = Result<(Box<dyn Any + Send + 'static>, TypeId), CmdProcessError>> + Send - { + ) -> impl Future<Output = Result<AnyOutput, CmdProcessError>> + Send { async move { let mut full_args = vec!["jv".to_string()]; @@ -173,7 +174,7 @@ where fn exec( input: Input, collect: Collect, - ) -> impl Future<Output = Result<(Box<dyn Any + Send + 'static>, TypeId), CmdExecuteError>> + Send; + ) -> impl Future<Output = Result<AnyOutput, CmdExecuteError>> + Send; /// Get output type mapping fn get_output_type_mapping() -> HashMap<String, TypeId>; |
