pub trait Provider: Debug + Send + Sync {
    // Required methods
    fn supports(&self, script_path: &str) -> bool;
    fn run(
        &self,
        full_script_path: &Path,
        args: Value,
        methods: Arc<dyn RuntimeMethods>
    ) -> Result<(), ProviderError>;
}
Expand description

Trait for effect providers.

An effect provider is able to load an effect script and run it when given input parameters.

Required Methods§

source

fn supports(&self, script_path: &str) -> bool

Returns if this provider supports the given effect

Parameters
  • script_path: path to the script file describing this effect. This is the script field in the effect definition JSON.
Returns

true if this provider can handle this script file, false otherwise.

source

fn run( &self, full_script_path: &Path, args: Value, methods: Arc<dyn RuntimeMethods> ) -> Result<(), ProviderError>

Run the given effect to completion in a blocking fashion

Parameters
  • full_script_path: resolved script path
  • args: arguments to the effect
  • methods: instance interaction methods

Implementors§