drt_chain_vm_executor/
service_trait.rs

1use crate::{Executor, VMHooks};
2
3pub type ExecutorError = Box<dyn std::error::Error>;
4
5pub trait ExecutorLastError {
6    /// Updates the last known error.
7    fn update_last_error_str(&mut self, err_str: String);
8
9    /// Returns the last known error.
10    fn get_last_error_string(&self) -> String;
11}
12
13pub trait ExecutorService: ExecutorLastError {
14    /// Creates a new VM executor.
15    fn new_executor(
16        &self,
17        vm_hooks_builder: Box<dyn VMHooks>,
18    ) -> Result<Box<dyn Executor>, ExecutorError>;
19}