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§
Sourcefn new(code: &[u8], builder: &Self::Builder, state: &mut T) -> Result<Self>
fn new(code: &[u8], builder: &Self::Builder, state: &mut T) -> Result<Self>
Instantiate a module with the given env builder
Sourcefn invoke(&mut self, name: &str, args: &[Value], state: &mut T) -> Result<Value>
fn invoke(&mut self, name: &str, args: &[Value], state: &mut T) -> Result<Value>
invoke an exported function
Sourcefn get_global_val(&self, name: &str) -> Option<Value>
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.