#rogue-like

bracket-embedding

Provides resource embedding services for bracket-lib

1 unstable release

0.8.7 Oct 4, 2022

#2311 in Game dev

Download history 488/week @ 2024-07-22 452/week @ 2024-07-29 463/week @ 2024-08-05 760/week @ 2024-08-12 517/week @ 2024-08-19 689/week @ 2024-08-26 623/week @ 2024-09-02 450/week @ 2024-09-09 491/week @ 2024-09-16 617/week @ 2024-09-23 476/week @ 2024-09-30 136/week @ 2024-10-07 447/week @ 2024-10-14 441/week @ 2024-10-21 524/week @ 2024-10-28 434/week @ 2024-11-04

1,860 downloads per month
Used in 10 crates (2 directly)

MIT license

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