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: generic.rs
    path of file: ./repos/vagga/src/builder/commands
    
    the code of the file until where you have to start completion: use std::env;
use std::io;
use std::path::{Path, PathBuf};
use std::collections::BTreeMap;
#[cfg(feature="containers")] use std::os::unix::io::RawFd;

#[cfg(feature="containers")] use unshare::{Command, Namespace};
#[cfg(feature="containers")] use libc;
#[cfg(feature="containers")] use nix;
use quire::validate as V;

#[cfg(feature="containers")]
use crate::{
    builder::context::Context,
    launcher::network::create_isolated_network,
    process_util::{capture_output, CaptureOutput, cmd_show, run_success},
};
use crate::build_step::{BuildStep, Config, Digest, Guard, StepError, VersionError};

// Build Steps
#[derive(Debug, Serialize, Deserialize)]
pub struct Sh(String);

impl Sh {
    pub fn config() -> V::Scalar {
        V::Scalar::new()
    }
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Cmd(Vec<String>);

impl Cmd {
    pub fn config() -> V::Sequ
    
    fn name(&self) -> &'static str { "RunAs" }
    #[cfg(feature="containers")]
    fn hash(&self, _cfg: &Config, hash: &mut Digest)
        -> Result<(), VersionError>
    {
        hash.field("user_id", self.user_id);
        hash.field("group_id", self.group_id);
        hash.opt_field("external_user_id", &self.external_user_id);
        hash.field("supplementary_gids", &self.supplementary_gids);
        hash.field("work_dir", &self.work_dir);
        hash.field("isolate_network", self.isolate_network);
        hash.field("script", &self.script);
        Ok(())
    }
    #[cfg(feature="containers")]
    fn build(&self, guard: &mut Guard, build: bool)
        -> Result<(), StepError>
    {
        if build {
            let netns_file = if self.isolate_network {
                match guard.ctx.network_namespace {
                    Some(ref netns_file) => {
                        Some(netns_file)
                    },
                    None => {
                        let isolated_network = try_msg!(
                            create_isolated_network(),
                            "Cannot create network namespace: {err}");
                        guard.ctx.network_namespace = Some(isolated_network.netns);
                        guard.ctx.network_namespace.as_ref()
                    },
                }
            } else {
                None
            };

            let mut cmd = Command::new(env::current_exe().unwrap());
            cmd.arg("__runner__");
            cmd.arg("run_as");
            set_environ(&guard.ctx, &mut cmd);
            cmd.arg("--work-dir").arg(&Path::new("/work").join(&self.work_dir));
            if let Some(netns_file) = netns_file {
                try_msg!(cmd.set_namespace(netns_file, Namespace::Net),
                    "Cannot set namespace for command: {err}");
            }

            let uid = self.user_id;
            let gid = self.group_id;
            if let Some(euid) = self.external_user_id {
                cmd.arg("--external-user-id").arg(euid.to_string());
            }
            cmd.arg("--user-id").arg(uid.to_string());
            cmd.arg("--group-id").arg(gid.to_string());
            if !self.supplementary_gids.is_empty() {
                let supplementary_gids = self.supplementary_gids.iter()
                    .map(|g| g.to_string())
                    .collect::<Vec<_>>();
                cmd.arg("--supplementary-gids").args(&supplementary_gids[..]);
            }
            cmd.arg("--");
            cmd.arg(&self.script);

            run(cmd)
        } else {
            Ok(())
        }
    }
    fn is_dependent_on(&self) -> Option<&str> {
        None
    }
}