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: generate.rs
    path of file: ./repos/aya/aya-tool/src
    
    the code of the file until where you have to start completion: use std::{
    fs::{self, File},
    io::{self, Write},
    path::{Path, PathBuf},
    process::Command,
    str,
};

use tempfile::tempdir;
use thiserror::Error;

use crate::bindgen;

#[derive(Error, Debug)]
pub enum Error {
    #[error("error executing bpftool")]
    BpfTool(#[source] io::Error),

    #[error("{stderr}\nbpftool failed with exit code {code}")]
    BpfToolExit { code: i32, stderr: String },

    #[error("bindgen failed")]
    Bindgen(#[source] io::Error),

    #[error("{stderr}\nbindgen failed with exit code {code}")]
    BindgenExit { code: i32, stderr: String },

    #[error("rustfmt failed")]
    Rustfmt(#[source] io::Error),

    #[error("error reading header file")]
    ReadHeaderFile(#[source] io::Error),
}

pub enum InputFile {
    Btf(PathBuf),
    Header(PathBuf),
}

pub fn generate<T: AsRef
    
    fn test_extract_ctypes_prefix() {
        let (flags, prefix) = extract_ctypes_prefix(&to_vec("foo --ctypes-prefix bar baz"));
        assert_eq!(flags, to_vec("foo baz"));
        assert_eq!(prefix.as_deref(), Some("bar"));

        let (flags, prefix) = extract_ctypes_prefix(&to_vec("foo --ctypes-prefi bar baz"));
        assert_eq!(flags, to_vec("foo --ctypes-prefi bar baz"));
        assert_eq!(prefix, None);

        let (flags, prefix) = extract_ctypes_prefix(&to_vec("--foo bar --ctypes-prefix"));
        assert_eq!(flags, to_vec("--foo bar --ctypes-prefix"));
        assert_eq!(prefix, None);

        let (flags, prefix) = extract_ctypes_prefix(&to_vec("--ctypes-prefix foo"));
        let empty: Vec<String> = Vec::new();
        assert_eq!(flags, empty);
        assert_eq!(prefix.as_deref(), Some("foo"));

        let (flags, prefix) = extract_ctypes_prefix(&to_vec("--ctypes-prefix"));
        assert_eq!(flags, to_vec("--ctypes-prefix"));
        assert_eq!(prefix, None);
    }