Instance

Trait Instance 

Source
pub trait Instance<T>: Sized {
    type Builder: Builder<T>;

    // Required methods
    fn new(code: &[u8], builder: &Self::Builder, state: &mut T) -> Result<Self>;
    fn invoke(
        &mut self,
        name: &str,
        args: &[Value],
        state: &mut T,
    ) -> Result<Value>;
    fn get_global_val(&self, name: &str) -> Option<Value>;
}
Expand description

Inkpad executor instance

Required Associated Types§

Required Methods§

Source

fn new(code: &[u8], builder: &Self::Builder, state: &mut T) -> Result<Self>

Instantiate a module with the given env builder

Source

fn invoke(&mut self, name: &str, args: &[Value], state: &mut T) -> Result<Value>

invoke an exported function

Source

fn get_global_val(&self, name: &str) -> Option<Value>

Get global value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§