Skip to main content

ScriptFnBody

Type Alias ScriptFnBody 

Source
pub type ScriptFnBody = Arc<dyn Fn(&mut ScriptFnCx<'_>) -> ScriptResult + Send + Sync>;
Expand description

The callable half of a ScriptFn. Shared so one description binds into several hosts, Send + Sync so it runs on any of their threads.

A body that fails hands back the message the script sees. Each host raises it the way its language raises: a Rhai runtime error, a Lua error(...), a candela host_fn_error the script can catch. The message names the function, so a failure is attributable without a stack trace.

Aliased Typeยง

pub struct ScriptFnBody { /* private fields */ }