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/nutype/nutype_macros/src/common/gen
    
    the code of the file until where you have to start completion: pub mod error;
pub mod new_unchecked;
pub mod parse_error;
pub mod tests;
pub mod traits;

use std::{collections::HashSet, hash::Hash};

use self::traits::GeneratedTraits;

use super::models::{
    ErrorT
    
                pub fn new(raw_value: #input_type) -> ::core::result::Result<Self, #error_type_name> {
                    // Keep sanitize() and validate() within new() so they do not overlap with outer
                    // scope imported with `use super::*`.
                    #sanitize
                    #validate

                    #convert_raw_value_if_necessary

                    let sanitized_value: #inner_type = sanitize(raw_value);
                    validate(&sanitized_value)?;
                    Ok(#type_name(sanitized_value))
                }