1 unstable release
0.8.7 | Oct 4, 2022 |
---|
#2311 in Game dev
1,860 downloads per month
Used in 10 crates
(2 directly)
83KB
60 lines
Bracket-embedding
bracket-lib
includes a system for embedding resources inside your binary (particularly useful for wasm builds).
This crate provides the supporting infrastructure for the embedding. It's not a lot of use on its own.
Example of use
use bracket_embedding::prelude::*;
embedded_resource!(SOURCE_FILE, "embedding.rs");
fn main() {
// This helper macro links the above embedding, allowing it to be accessed as a resource from various parts of the program.
link_resource!(SOURCE_FILE, "embedding.rs");
}
lib.rs
:
The bracket-embedding
crate is used to provide resource embedding.
This allows you to include binary assets inside your program when shipping,
with no external files. This can be especially useful for WASM builds.
For example:
use bracket_embedding::prelude::*;
embedded_resource!(SOURCE_FILE, "embedding.rs");
fn main() {
// This helper macro links the above embedding, allowing it to be accessed as a resource from various parts of the program.
link_resource!(SOURCE_FILE, "embedding.rs");
}
This crate isn't very useful on its own, but is heavily used by the other parts of bracket-lib
.
Dependencies
~0.4–5MB
~11K SLoC