pub trait Runner {
// Required method
fn execute(
&self,
code: &str,
checks: &[String],
) -> impl Future<Output = Result<ExecutionResult, RunnerError>> + Send;
}Expand description
Runs learner code and reports what it did.
The seam every execution and grading slice depends on (§3.4). execute is
fallible: an Err means the interpreter never ran (spawn or IO failure),
which is categorically distinct from the program running and writing to
stderr — so ExecutionResult never has to encode “we could not start”.
Declared returning impl Future rather than with async fn so the public
trait stays clear of the async_fn_in_trait lint under -D warnings.
Required Methods§
Sourcefn execute(
&self,
code: &str,
checks: &[String],
) -> impl Future<Output = Result<ExecutionResult, RunnerError>> + Send
fn execute( &self, code: &str, checks: &[String], ) -> impl Future<Output = Result<ExecutionResult, RunnerError>> + Send
Execute code, returning its normalized ExecutionResult.
checks is reserved for the grading slice (which refines its element
type); v1 execution does not yet consume it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.