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: runtime.rs
    path of file: ./repos/prisma-client-rust/crates/sdk/src
    
    the code of the file until where you have to start completion: use std::{
    fs::{self, remove_dir_all, File},
    io::{stderr, stdin, BufRead, BufReader, Write},
    path::Path,
    sync::Arc,
};

use crate::{
    prelude::*,
    shared_config::{ClientFormat, SharedConfig},
};

use dmmf::from_precomputed_parts;
use query_core::schema;

use crate::{
    args::GenerateArgs, dmmf::EngineDMMF, jsonrpc, utils::rustfmt, GenerateFn, GeneratorError,
};

pub struct GeneratorMetadata {
    generate_fn: GenerateFn,
    name: &'static str,
    default_output: &'static str,
}

impl GeneratorMetadata {
    pub fn new(generate_fn: GenerateFn, name: &'static str, default_output: &'static str) -> Self {
        Self {
            generate_fn,
            name,
            default_output,
        }
    }

    pub fn run(self) {
        loop {
            let mut content = String::new();
            BufReader::new(stdin())
                .read_line(&mut content)
                .expect("Failed to read engine output");

            let input: jsonrpc::Request =
                serde_json::from_str(&content).expect("Failed to marshal jsonrpc input");

            le
    
    fn generate(&self, engine_dmmf: EngineDMMF) -> Result<(), GeneratorError> {
        let schema = Arc::new(
            psl::parse_schema(engine_dmmf.datamodel.as_str())
                .expect("Datamodel is invalid after being verified by CLI?!"),
        );
        let query_schema = Arc::new(schema::build(schema.clone(), true));
        let dmmf = from_precomputed_parts(&query_schema);

        let output_str = engine_dmmf.generator.output.get_value();
        let root_output_path = Path::new(&output_str);

        let config = engine_dmmf.generator.config.clone();

        let shared_config: SharedConfig =
            serde_json::from_value(serde_json::Value::Object(config.clone())).unwrap();

        match shared_config.client_format {
            ClientFormat::Folder if root_output_path.extension().is_some() => {
                panic!("The output path must be a directory when using the folder format.")
            }
            ClientFormat::File if root_output_path.extension().is_none() => {
                panic!("The output path must be a file when using the file format.")
            }
            _ => {}
        }

        let root_module =
            (self.generate_fn)(GenerateArgs::new(&schema, &dmmf, engine_dmmf), config)?;

        remove_dir_all(root_output_path).ok();

        let header = format!("// File generated by {}. DO NOT EDIT\n\n", self.name);

        match shared_config.client_format {
            ClientFormat::Folder => {
                write_module_to_file(&root_module, root_output_path, &header);
            }
            ClientFormat::File => write_to_file(&root_module.flatten(), root_output_path, &header),
        }

        rustfmt(&root_module.get_all_paths(root_output_path));

        Ok(())
    }