use crate::{BreakpointValue, ExecutorError};
pub struct CompilationOptions {
pub gas_limit: u64,
pub unmetered_locals: usize,
pub max_memory_grow: usize,
pub max_memory_grow_delta: usize,
pub opcode_trace: bool,
pub metering: bool,
pub runtime_breakpoints: bool,
}
pub type MemPtr = isize;
pub type MemLength = isize;
pub trait Instance {
fn call(&self, func_name: &str) -> Result<(), String>;
fn check_signatures(&self) -> bool;
fn has_function(&self, func_name: &str) -> bool;
fn get_exported_function_names(&self) -> Vec<String>;
fn set_points_limit(&self, limit: u64) -> Result<(), String>;
fn set_points_used(&self, points: u64) -> Result<(), String>;
fn get_points_used(&self) -> Result<u64, String>;
fn memory_length(&self) -> Result<u64, String>;
fn memory_ptr(&self) -> Result<*mut u8, String>;
fn memory_load(&self, mem_ptr: MemPtr, mem_length: MemLength) -> Result<&[u8], ExecutorError>;
fn memory_store(&self, mem_ptr: MemPtr, data: &[u8]) -> Result<(), ExecutorError>;
fn memory_grow(&self, by_num_pages: u32) -> Result<u32, ExecutorError>;
fn set_breakpoint_value(&self, value: BreakpointValue) -> Result<(), String>;
fn get_breakpoint_value(&self) -> Result<BreakpointValue, String>;
fn reset(&self) -> Result<(), String>;
fn cache(&self) -> Result<Vec<u8>, String>;
}