Crates.io | tauri_includedir |
lib.rs | tauri_includedir |
version | 0.6.1 |
source | src |
created_at | 2019-12-16 22:46:46.956373 |
updated_at | 2021-06-06 00:35:38.285621 |
description | This crate was deprecated. It is now part of the `tauri-codegen` crate. |
homepage | https://github.com/tilpner/includedir |
repository | https://github.com/tilpner/includedir |
max_upload_size | |
id | 189864 |
size | 4,484 |
This crate was deprecated. It is now part of the tauri-codegen
crate.
Include a directory in your Rust binary, e.g. static files for your web server or assets for your game.
Cargo.toml
[package]
name = "example"
version = "0.1.0"
build = "build.rs"
include = ["data"]
[dependencies]
phf = "0.8.0"
tauri_includedir = "0.5.0"
[build-dependencies]
tauri_includedir_codegen = "0.5.0"
build.rs
extern crate tauri_includedir_codegen;
use tauri_includedir_codegen::Compression;
fn main() {
tauri_includedir_codegen::start("FILES")
.dir("data", Compression::Gzip)
.build("data.rs")
.unwrap();
}
src/main.rs
extern crate tauri_includedir;
extern crate phf;
use std::env;
include!(concat!(env!("OUT_DIR"), "/data.rs"));
fn main() {
FILES.set_passthrough(env::var_os("PASSTHROUGH").is_some());
println!("{:?}", FILES.get("data/foo"))
}