dharitri_vm_executor/new_traits/
instance_state.rs1use crate::{ExecutorError, MemLength, MemPtr};
2
3pub trait InstanceState {
5 fn get_points_used(&mut self) -> Result<u64, ExecutorError>;
7
8 fn set_points_used(&mut self, points: u64) -> Result<(), ExecutorError>;
10
11 fn memory_load_to_slice(&self, mem_ptr: MemPtr, dest: &mut [u8]) -> Result<(), ExecutorError>;
13
14 fn memory_load_owned(
16 &self,
17 mem_ptr: MemPtr,
18 mem_length: MemLength,
19 ) -> Result<Vec<u8>, ExecutorError>;
20
21 fn memory_store(&self, mem_ptr: MemPtr, data: &[u8]) -> Result<(), ExecutorError>;
23}