Use static array for codegen parameters info.

This commit is contained in:
Stephen Chung
2021-03-25 14:02:50 +08:00
parent 1d661f2c8e
commit adbb5f8eb8
8 changed files with 233 additions and 774 deletions

View File

@@ -1,7 +1,7 @@
//! Module defining macros for developing _plugins_.
pub use crate::fn_native::{CallableFunction, FnCallArgs};
pub use crate::stdlib::{any::TypeId, boxed::Box, format, mem, string::ToString, vec as new_vec};
pub use crate::stdlib::{any::TypeId, boxed::Box, format, mem, string::ToString};
pub use crate::{
Dynamic, Engine, EvalAltResult, FnAccess, FnNamespace, ImmutableString, Module,
NativeCallContext, Position,
@@ -26,13 +26,4 @@ pub trait PluginFunction {
/// Is this plugin function variadic?
fn is_variadic(&self) -> bool;
/// Convert a plugin function into a boxed trait object.
fn clone_boxed(&self) -> Box<dyn PluginFunction>;
/// Return a boxed slice of the names of the function's parameters and return type.
fn param_names(&self) -> Box<[&'static str]>;
/// Return a boxed slice of type ID's of the function's parameters.
fn input_types(&self) -> Box<[TypeId]>;
}