1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pub use crate::ast::FnAccess;
pub use crate::dynamic::Dynamic;
pub use crate::engine::Engine;
pub use crate::fn_native::{CallableFunction, FnCallArgs, NativeCallContext};
pub use crate::fn_register::{RegisterFn, RegisterResultFn};
pub use crate::module::Module;
pub use crate::result::EvalAltResult;
pub use crate::utils::ImmutableString;
pub use crate::stdlib::{any::TypeId, boxed::Box, format, mem, string::ToString, vec as new_vec};
#[cfg(not(features = "no_module"))]
pub use rhai_codegen::*;
#[cfg(features = "no_module")]
pub use rhai_codegen::{export_fn, register_exported_fn};
pub trait PluginFunction {
fn call(
&self,
context: NativeCallContext,
args: &mut FnCallArgs,
) -> Result<Dynamic, Box<EvalAltResult>>;
fn is_method_call(&self) -> bool;
fn is_variadic(&self) -> bool;
fn clone_boxed(&self) -> Box<dyn PluginFunction>;
fn input_types(&self) -> Box<[TypeId]>;
}