You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: wasmedge.rs
    path of file: ./repos/youki/crates/youki/src/workload
    
    the code of the file until where you have to start completion: use libcontainer::oci_spec::runtime::Spec;
use wasmedge_sdk::{
    config::{CommonConfigOptions, ConfigBuilder, HostRegistrationConfigOptions},
    params, VmBuilder,
};

use libcontainer::workload::{Executor, ExecutorError, ExecutorValidationError};

const EXECUTOR_NAME: &str = "wasmedge";

#[derive(Clone)]
pub struct WasmedgeExecutor {}

impl Executor for WasmedgeExecutor {
    fn exec(&self, spec: &Spec) -> Result<(), ExecutorError> {
        if !can_handle(spec) {
            return Err(ExecutorError::CantHandle(EXECUTOR_NAME));
        }

        tracing::debug!("executing workload with wasmedge handler");

        // parse wasi parameters
        let args = get_args(spec);
        let mut cmd = args[0].clone();
        if let Some(stripped) = args[0].strip_prefix(std::path::MAIN_SEPARATOR) {
            cmd = stripped.to_string();
        }
        let envs = env_to_wasi(spec);

        // create configuration with `wasi` option enabled
        let config = ConfigBuilder::new(CommonConfigOptions::default())
            .with_host_registration_config(HostRegistrationConfigOptions::default().wasi(true))
            .build()
            .map_err(|err| {
                ExecutorError::Other(format!("failed to create wasmedge config: {}", err))
            })?;

        // create a vm with the config settings
        let mut vm = VmBuilder::new()
            .with_config(config)
            .build()
            .map_err(|err| ExecutorError::Other(format!("failed to create wasmedge vm: {}", err)))?
            .register_module_from_file("main", cmd)
            .map_err(|err| {
                ExecutorError::Other(format!(
                    "failed to register wasmedge module
    
    fn exec(&self, spec: &Spec) -> Result<(), ExecutorError> {
        if !can_handle(spec) {
            return Err(ExecutorError::CantHandle(EXECUTOR_NAME));
        }

        tracing::debug!("executing workload with wasmedge handler");

        // parse wasi parameters
        let args = get_args(spec);
        let mut cmd = args[0].clone();
        if let Some(stripped) = args[0].strip_prefix(std::path::MAIN_SEPARATOR) {
            cmd = stripped.to_string();
        }
        let envs = env_to_wasi(spec);

        // create configuration with `wasi` option enabled
        let config = ConfigBuilder::new(CommonConfigOptions::default())
            .with_host_registration_config(HostRegistrationConfigOptions::default().wasi(true))
            .build()
            .map_err(|err| {
                ExecutorError::Other(format!("failed to create wasmedge config: {}", err))
            })?;

        // create a vm with the config settings
        let mut vm = VmBuilder::new()
            .with_config(config)
            .build()
            .map_err(|err| ExecutorError::Other(format!("failed to create wasmedge vm: {}", err)))?
            .register_module_from_file("main", cmd)
            .map_err(|err| {
                ExecutorError::Other(format!(
                    "failed to register wasmedge module from the file: {}",
                    err
                ))
            })?;
        // initialize the wasi module with the parsed parameters
        let wasi_instance = vm
            .wasi_module_mut()
            .expect("config doesn't contain HostRegistrationConfigOptions");
        wasi_instance.initialize(
            Some(args.iter().map(|s| s as &str).collect()),
            Some(envs.iter().map(|s| s as &str).collect()),
            None,
        );

        vm.run_func(Some("main"), "_start", params!())
            .map_err(|err| ExecutorError::Execution(err))?;

        Ok(())
    }