grouse
A simple asset bundler for Rust.
about
grouse is a very simple asset bundler intended for baking static web content
directly into your Rust binaries. This library can be thought of a more
specialized version of the fantastic include_dir crate; Whilst include_dir
provides a more traditional tree-like view of the embedded assets, grouse uses
sha256 to generate a digest of each file and provides a flat, hashmap-like
view of digest, file pairs. This is particularly useful when serving static web
content, as changes to any files will effectively change the name of that file
being served, and invalidate any browser caches.
getting started
To start using grouse, you'll first need to add our package to your
Cargo.toml manifest:
Then you can bundle a directory into your Rust executable.
// Thanks to recently stablized proc-macro features, the include
// path is relative to the current file directory, like how the
// builtin [`core::include_bytes!`] macro works.
const MANIFEST: = include!;