web-static-pack
Embed static resources (GUI, assets, images, styles, html) within executable. Serve with hyper or any server of your choice.
Usage scenario:
- Combines given directory tree into single, fast, binary-based single-file representation, called
pack
. Use simple CLI toolweb-static-pack-packer
to create a pack. - Pack could be embedded into your application using
include_bytes!
single macro. - Super-fast, zero-copy
loader
provides by-name access to files. - Easy-to-use
hyper_loader
allows super-quick integration with hyper-based server.
Features:
- Super fast, low overhead
- 100% 'static access, zero data copy
- 100% pack-time calculated
Content-Type
,ETag
(using sha3) - 100% pack-time calculated gzip-compressed files
- Almost no external dependencies
Limitations:
- By default all files with guesses text/ content type are treated as utf-8
- Packs are not guaranteed to be portable across versions / architectures
Future goals:
- You tell me
Non-Goals:
- Directory listings
- automatic index.html resolving
- Uploads
Example:
- Create a pack from
cargo doc
:
- Serve docs.pack from your web-application (see
examples/docs
)
use ;
use ;
use lazy_static;
use LevelFilter;
use SimpleLogger;
use ;
use ;
async
async
async