All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rust-server.server-paths.mustache Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
mod paths {
    use lazy_static::lazy_static;

    lazy_static! {
        pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
{{#pathSet}}
            r"^{{{basePathWithoutHost}}}{{{pathRegEx}}}"{{^-last}},{{/-last}}
{{/pathSet}}
        ])
        .expect("Unable to create global regex set");
    }
{{#pathSet}}
    pub(crate) static ID_{{{PATH_ID}}}: usize = {{{index}}};
{{#hasPathParams}}
    lazy_static! {
        pub static ref REGEX_{{{PATH_ID}}}: regex::Regex =
            #[allow(clippy::invalid_regex)]
            regex::Regex::new(r"^{{{basePathWithoutHost}}}{{{pathRegEx}}}")
                .expect("Unable to create regex for {{{PATH_ID}}}");
    }
{{/hasPathParams}}
{{/pathSet}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy