Introduce RhaiResult.
This commit is contained in:
@@ -4,7 +4,7 @@ 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::{
|
||||
Dynamic, Engine, EvalAltResult, FnAccess, FnNamespace, ImmutableString, Module,
|
||||
NativeCallContext, Position, RegisterFn, RegisterResultFn,
|
||||
NativeCallContext, Position, RegisterFn, RegisterResultFn, RhaiResult,
|
||||
};
|
||||
|
||||
#[cfg(not(features = "no_module"))]
|
||||
@@ -18,11 +18,7 @@ pub use rhai_codegen::{export_fn, register_exported_fn};
|
||||
/// Use the `#[export_module]` and `#[export_fn]` procedural attributes instead.
|
||||
pub trait PluginFunction {
|
||||
/// Call the plugin function with the arguments provided.
|
||||
fn call(
|
||||
&self,
|
||||
context: NativeCallContext,
|
||||
args: &mut FnCallArgs,
|
||||
) -> Result<Dynamic, Box<EvalAltResult>>;
|
||||
fn call(&self, context: NativeCallContext, args: &mut FnCallArgs) -> RhaiResult;
|
||||
|
||||
/// Is this plugin function a method?
|
||||
fn is_method_call(&self) -> bool;
|
||||
|
Reference in New Issue
Block a user