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: prost_codegen.rs
    path of file: ./repos/grpc-rs/compiler/src
    
    the code of the file until where you have to start completion: // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

use std::io::{Error, ErrorKind, Read};
use std::path::Path;
use std::{env, fs, io, process::Command, str};

use derive_new::new;
use prost::Message;
use prost_build::{Config, Method, Service, ServiceGenerator};
use prost_types::FileDescriptorSet;

use crate::util::{fq_grpc, to_snake_case, MethodType};

/// Returns the names of all packages compiled.

    
fn generate_server(service: &Service, buf: &mut String) {
    buf.push_str("pub trait ");
    buf.push_str(&service.name);
    buf.push_str(" {\n");
    generate_server_methods(service, buf);
    buf.push_str("}\n");

    buf.push_str("pub fn create_");
    buf.push_str(&to_snake_case(&service.name));
    buf.push_str("<S: ");
    buf.push_str(&service.name);
    buf.push_str(" + Send + Clone + 'static>(s: S) -> ");
    buf.push_str(&fq_grpc("Service"));
    buf.push_str(" {\n");
    buf.push_str("let mut builder = ::grpcio::ServiceBuilder::new();\n");

    for method in &service.methods[0..service.methods.len() - 1] {
        buf.push_str("let mut instance = s.clone();\n");
        generate_method_bind(&service.name, method, buf);
    }

    buf.push_str("let mut instance = s;\n");
    generate_method_bind(
        &service.name,
        &service.methods[service.methods.len() - 1],
        buf,
    );

    buf.push_str("builder.build()\n");
    buf.push_str("}\n");
}