#gamedev #resources

nightly resources_package

Macro that allows you to package files inside your libraries or executables

10 releases

Uses old Rust 2015

0.1.0 Oct 2, 2015
0.0.8 Jun 24, 2015
0.0.7 Mar 6, 2015
0.0.5 Feb 9, 2015
0.0.1-pre.1 Nov 20, 2014

#1059 in Rust patterns

Apache-2.0

8KB
123 lines

Build Status

This crate allows you to package several files in your executable.

This is similar to include_bin! but easier to use when you have a lot of files.

Usage:

#![feature(phase)]

#[phase(plugin)]
extern crate resources_package;
extern crate resources_package_package;

static package: resources_package_package::Package = resources_package!([
    "path/to/resources",
    "other/path/to/resources"
]);

fn main() {
    for &(ref name, content) in package.iter() {
        println!("{}", name.display());
    }
}

lib.rs:

This crate allows you to package several files in your executable.

This is similar to include_bytes! but easier to use when you have a lot of files.

Usage:

#![feature(phase)]

#[phase(plugin)]
extern crate resources_package;
extern crate resources_package_package;

static package: resources_package_package::Package = resources_package!([
    "path/to/resources",
    "other/path/to/other/resources"
]);
# fn main() {}

The type of the static variable is a resources_package_package::Package. See the documentation of resources_package_package.

Arguments

  • List of directories whose content is to be included.

Dependencies