aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_core/src/program.rs')
-rw-r--r--mingling_core/src/program.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs
index c7544f5..f305e88 100644
--- a/mingling_core/src/program.rs
+++ b/mingling_core/src/program.rs
@@ -8,7 +8,7 @@ use crate::error::GeneralRendererSerializeError;
use std::env;
use crate::{
- AnyOutput, ChainProcess, GlobalResources, RenderResult,
+ AnyOutput, ChainProcess, GlobalResources, Groupped, RenderResult,
asset::dispatcher::Dispatcher,
error::{ChainProcessError, ProgramExecuteError},
};
@@ -148,6 +148,19 @@ where
Err(e) => Err(e.into()),
}
}
+
+ /// Use a prefix tree to quickly match arguments and dispatch to an Entry
+ #[cfg(feature = "dispatch_tree")]
+ pub fn dispatch_args_trie(
+ &'static self,
+ args: impl Into<StringVec>,
+ ) -> Result<AnyOutput<C>, ChainProcessError> {
+ let string_vec: Vec<String> = args.into().into();
+ match C::dispatch_args_trie(&string_vec) {
+ Ok(ok) => Ok(ok),
+ Err(e) => Err(e.into()),
+ }
+ }
}
// Async program