Function actix_plus_static_files::build_hashmap_from_included_dir[][src]

pub fn build_hashmap_from_included_dir(
    dir: &'static Dir<'_>
) -> HashMap<&'static str, Resource>

The Dir type as loaded by the re-exported macro from the include_dir crate provides a recursive data structure with nested directories, but a HashMap of paths to resources is more conducive to serving requests. This function performs the necessary recursion to translate from the former to the latter, and should be called at runtime when initializing Actix web routes.