wasmer_wasix/runners/runner.rs
1use std::sync::Arc;
2
3use anyhow::Error;
4use webc::metadata::Command;
5
6use crate::{Runtime, bin_factory::BinaryPackage};
7
8/// Trait that all runners have to implement
9pub trait Runner {
10 /// Returns whether the Runner will be able to run the `Command`
11 fn can_run_command(command: &Command) -> Result<bool, Error>
12 where
13 Self: Sized;
14
15 /// Run a command.
16 fn run_command(
17 &mut self,
18 command_name: &str,
19 pkg: &BinaryPackage,
20 runtime: Arc<dyn Runtime + Send + Sync>,
21 ) -> Result<(), Error>;
22}