pub trait HostFunction<T: HostType> {
// Required methods
fn run(
&self,
arguments: &[WanderValue<T>],
bindings: &Environment<T>,
) -> Result<WanderValue<T>, WanderError>;
fn binding(&self) -> HostFunctionBinding;
}
Expand description
A trait representing a function exported from the hosting application that can be called from Wander.
Required Methods§
Sourcefn run(
&self,
arguments: &[WanderValue<T>],
bindings: &Environment<T>,
) -> Result<WanderValue<T>, WanderError>
fn run( &self, arguments: &[WanderValue<T>], bindings: &Environment<T>, ) -> Result<WanderValue<T>, WanderError>
The function called when the HostFunction is called from Wander.
Sourcefn binding(&self) -> HostFunctionBinding
fn binding(&self) -> HostFunctionBinding
Get the binding information for this HostFunction.