Skip to main content

Executor

Trait Executor 

Source
pub trait Executor: Send + Sync {
    // Required methods
    fn execute(
        &self,
        code: &str,
        input: &str,
        timeout_ms: u64,
    ) -> Result<ExecutionResult>;
    fn language(&self) -> Language;
}
Expand description

Code executor trait for running programs

Required Methods§

Source

fn execute( &self, code: &str, input: &str, timeout_ms: u64, ) -> Result<ExecutionResult>

Execute code with the given input

§Errors

Returns an error if execution fails

Source

fn language(&self) -> Language

Get the language this executor handles

Implementors§