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: mod.rs
    path of file: ./repos/Egregoria/native_app/src/newgui/inspect
    
    the code of the file until where you have to start completion: use crate::gui::debug_window::DebugState;
use crate::newgui::follow::FollowEntity;
use crate::newgui::{InspectedBuilding, InspectedEntity};
use crate::uiworld::UiWorld;
use goryak::{button_primary, primary_link};
use inspect_building::inspect_building;
use inspect_human::inspect_human;
use inspect_train::inspect_train;
use inspect_vehicle::inspect_vehicle;
use simulation::map::BuildingID;
use simulation::{AnyEntity, Simulation};
use slotmapd::Key;

mod inspect_building;
mod inspect_human;
mod inspect_train;
mod inspect_vehicle;

pub fn new_inspector(uiworld: &UiWorld, sim: &Simulation) {
    profiling::scope!("hud::inspector");
    let inspected_building = *uiworld.read::<InspectedBuilding>();
    if let Some(b) = inspected_building.e {
        let is_open = inspect_building(uiworld, sim, b);
        if !is_open {
            uiworld.write::<InspectedBuilding>().e = None;
        }
    }

    let e = unwrap_or!(uiworld.read::<InspectedEntity>().e, return);

    let force_debug_inspect = uiworld.read::<DebugState>().debug_inspector;
    if force_debug_inspect {
        return;
    }

    let mut is_open = true;
    match e {
      
    
pub fn new_inspector(uiworld: &UiWorld, sim: &Simulation) {
    profiling::scope!("hud::inspector");
    let inspected_building = *uiworld.read::<InspectedBuilding>();
    if let Some(b) = inspected_building.e {
        let is_open = inspect_building(uiworld, sim, b);
        if !is_open {
            uiworld.write::<InspectedBuilding>().e = None;
        }
    }

    let e = unwrap_or!(uiworld.read::<InspectedEntity>().e, return);

    let force_debug_inspect = uiworld.read::<DebugState>().debug_inspector;
    if force_debug_inspect {
        return;
    }

    let mut is_open = true;
    match e {
        AnyEntity::HumanID(id) if !force_debug_inspect => {
            is_open = inspect_human(uiworld, sim, id);
        }
        AnyEntity::VehicleID(id) if !force_debug_inspect => {
            is_open = inspect_vehicle(uiworld, sim, id);
        }
        AnyEntity::WagonID(id) if !force_debug_inspect => {
            let Some(w) = sim.world().get(id) else {
                return;
            };
            let train_id = w.itfollower.leader;
            uiworld.write::<InspectedEntity>().e = Some(AnyEntity::TrainID(train_id));
        }
        AnyEntity::TrainID(id) if !force_debug_inspect => {
            is_open = inspect_train(uiworld, sim, id);
        }
        _ => {}
    }

    if !is_open {
        uiworld.write::<InspectedEntity>().e = None;
    }
}