Trait HostFunction

Source
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§

Source

fn run( &self, arguments: &[WanderValue<T>], bindings: &Environment<T>, ) -> Result<WanderValue<T>, WanderError>

The function called when the HostFunction is called from Wander.

Source

fn binding(&self) -> HostFunctionBinding

Get the binding information for this HostFunction.

Implementors§