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: modres.rs
    path of file: ./repos/rant/src
    
    the code of the file until where you have to start completion: use std::{env, path::PathBuf, io::ErrorKind, fmt::Debug};
use super::*;

/// Result type used by the module loader.
pub type ModuleResolveResult = Result<RantProgram, ModuleResolveError>;

/// Represents the features required for a module resolver.
/// 
/// A module resolver only resolves the `RantProgram` that the final module object is loaded from.
/// This is designed as such to ensure that module loading is limited to the maximum call stack size of the requesting program.
pub trait ModuleResolver: Debug {
  fn try_resolve(&self, context: &mut Rant, module_path: &str, dependant: Option<&RantProgramInfo>) -> ModuleResolveResult;
}

/// The default filesystem-based module resolver.
/// 
/// ### Resolution strategy
/// This resolver uses the following strategy to locate module files:
/// 1. If triggered by a program, the program's containing directory is searched first.
/// 1. The directory specified in `local_modules_path` is searched next. If not specified, uses the host application's current working directory.
/// 1. If `enable_g
    
  fn try_resolve(&self, context: &mut Rant, module_path: &str, dependant: Option<&RantProgramInfo>) -> ModuleResolveResult {
    
    // Try to find module path that exists
    if let Some(full_module_path) = self.find_module_path(module_path, dependant) {
      let mut errors = vec![];
      let compile_result = context.compile_file(full_module_path, &mut errors);
      match compile_result {
        Ok(module) => Ok(module),
        Err(err) => {
          Err(ModuleResolveError {
            name: module_path.to_owned(),
            reason: match err{
              CompilerError::SyntaxError => {
                ModuleResolveErrorReason::CompileFailed(errors)
              },
              CompilerError::IOError(ioerr) => {
                match ioerr {
                  IOErrorKind::NotFound => {
                    ModuleResolveErrorReason::NotFound
                  },
                  _ => ModuleResolveErrorReason::FileIOError(ioerr)
                }
              }
            }
          })
        }
      }
    } else {
      Err(ModuleResolveError {
        name: module_path.to_owned(),
        reason: ModuleResolveErrorReason::NotFound,
      })
    }
  }