dharitri_vm_executor/new_traits/
instance_new.rs1use crate::{BreakpointValue, ExecutorError, VMHooksEarlyExit};
2
3pub enum InstanceCallResult {
4 Ok,
5 FunctionNotFound,
6 RuntimeError(ExecutorError),
7 VMHooksEarlyExit(VMHooksEarlyExit),
8 Breakpoint(BreakpointValue),
9}
10
11pub trait Instance {
13 fn call(&mut self, func_name: &str, points_limit: u64) -> InstanceCallResult;
15
16 fn check_signatures(&self) -> bool;
18
19 fn has_function(&self, func_name: &str) -> bool;
21
22 fn get_exported_function_names(&self) -> Vec<String>;
24
25 fn get_points_used(&mut self) -> Result<u64, ExecutorError>;
27
28 fn reset(&self) -> Result<(), ExecutorError>;
30
31 fn cache(&self) -> Result<Vec<u8>, ExecutorError>;
33}