pub enum RunnerKind {
R(RRunner),
Python(PythonRunner),
}Expand description
A runner chosen for a lesson’s language.
A closed enum holding one concrete runner. Runner::execute returns
impl Future (an RPITIT), so the trait is not object-safe and a
runtime-chosen runner cannot be a Box<dyn Runner>; an enum is how we carry
that choice instead. Consumers still depend on the Runner trait, not on
these concrete variants — RunnerKind itself impls it, so run_checks
takes impl Runner and never names RRunner/PythonRunner (§3.4). The
match over it is exhaustive: adding a Language variant forces a new arm
both here and in select_runner, so a language can never be silently
dropped.
Variants§
Trait Implementations§
Source§impl Clone for RunnerKind
impl Clone for RunnerKind
Source§fn clone(&self) -> RunnerKind
fn clone(&self) -> RunnerKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunnerKind
impl Debug for RunnerKind
Source§impl Runner for RunnerKind
impl Runner for RunnerKind
Source§async fn execute(
&self,
code: &str,
checks: &[String],
) -> Result<ExecutionResult, RunnerError>
async fn execute( &self, code: &str, checks: &[String], ) -> Result<ExecutionResult, RunnerError>
Auto Trait Implementations§
impl Freeze for RunnerKind
impl RefUnwindSafe for RunnerKind
impl Send for RunnerKind
impl Sync for RunnerKind
impl Unpin for RunnerKind
impl UnwindSafe for RunnerKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more