{"id":15640158,"url":"https://github.com/tilpner/includedir","last_synced_at":"2025-04-09T11:12:27.422Z","repository":{"id":57634516,"uuid":"51856821","full_name":"tilpner/includedir","owner":"tilpner","description":"Include a whole directory tree at compile time","archived":false,"fork":false,"pushed_at":"2020-05-27T11:50:13.000Z","size":55,"stargazers_count":81,"open_issues_count":5,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T09:08:17.661Z","etag":null,"topics":["assets","filesystem","include","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tilpner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-16T18:05:28.000Z","updated_at":"2024-06-28T17:52:05.000Z","dependencies_parsed_at":"2022-09-16T04:30:27.360Z","dependency_job_id":null,"html_url":"https://github.com/tilpner/includedir","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilpner%2Fincludedir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilpner%2Fincludedir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilpner%2Fincludedir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilpner%2Fincludedir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tilpner","download_url":"https://codeload.github.com/tilpner/includedir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027411,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","filesystem","include","rust"],"created_at":"2024-10-03T11:31:45.947Z","updated_at":"2025-04-09T11:12:27.390Z","avatar_url":"https://github.com/tilpner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"includedir\n===========\n\n[![Travis](https://img.shields.io/travis/tilpner/includedir.svg?style=flat-square)](https://travis-ci.org/tilpner/includedir)\n[![Appveyor](https://img.shields.io/appveyor/ci/tilpner/includedir.svg?label=appveyor\u0026style=flat-square)](https://ci.appveyor.com/project/tilpner/includedir)\n[![Crates.io version](https://img.shields.io/crates/v/includedir.svg?style=flat-square)](https://crates.io/crates/includedir)\n[![docs.rs](https://docs.rs/includedir/badge.svg)](https://docs.rs/includedir)\n[![Crates.io license](https://img.shields.io/crates/l/includedir.svg?style=flat-square)](https://crates.io/crates/includedir)\n\nInclude a directory in your Rust binary, e.g. static files for your web server or assets for your game.\n\n## Features\n\n* [x] Automatically compile data into binary\n* [x] Use [rust-phf](https://github.com/sfackler/rust-phf) for efficient lookup\n* [x] Wrapping API around the phf map, to abstract away additional features\n* [x] Compression, with optional crate \"flate2\"\n* [x] Reading from source files for debug builds\n\n## Example\n\n**Cargo.toml**\n```toml\n[package]\nname = \"example\"\nversion = \"0.1.0\"\n\nbuild = \"build.rs\"\ninclude = [\"data\"]\n\n[dependencies]\nphf = \"0.8.0\"\nincludedir = \"0.6.0\"\n\n[build-dependencies]\nincludedir_codegen = \"0.6.0\"\n```\n\n**build.rs**\n\n```rust\nextern crate includedir_codegen;\n\nuse includedir_codegen::Compression;\n\nfn main() {\n    includedir_codegen::start(\"FILES\")\n        .dir(\"data\", Compression::Gzip)\n        .build(\"data.rs\")\n        .unwrap();\n}\n```\n\n**src/main.rs**\n\n```rust\nextern crate includedir;\nextern crate phf;\n\nuse std::env;\n\ninclude!(concat!(env!(\"OUT_DIR\"), \"/data.rs\"));\n\nfn main() {\n    FILES.set_passthrough(env::var_os(\"PASSTHROUGH\").is_some());\n\n    println!(\"{:?}\", FILES.get(\"data/foo\"))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilpner%2Fincludedir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftilpner%2Fincludedir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilpner%2Fincludedir/lists"}