web_static_pack_common/lib.rs
1//! Common crate, containing types shared between
2//! [web-static-pack](https://crates.io/crates/web-static-pack) and
3//! [web-static-pack-packer](https://crates.io/crates/web-static-pack-packer).
4//!
5//! For a project documentation, examples, etc. see
6//! [web-static-pack](https://github.com/peku33/web-static-pack).
7//!
8//! The root type of this crate is [pack::Pack]. It's a collection (a hashmap)
9//! of files [file::File] distinguished by [pack_path::PackPath] (a custom type
10//! for path including some sanity checks).
11//!
12//! web-static-pack uses [rkyv] for serialization. Each module provides a rust
13//! native type, used during `pack` building, ex. [pack::Pack] and [rkyv]
14//! macro-generated zero-copy loadable (aka. mmapable) representation, eg.
15//! [pack::PackArchived], used by loader.
16//!
17//! ### Note
18//!
19//! There are also things called `Resolver` (eg. [pack::PackResolver]), that are
20//! needed internally by [rkyv], but are not used directly in this project. They
21//! should be hidden from docs.
22
23#![warn(missing_docs)]
24
25pub mod cache_control;
26pub mod file;
27pub mod pack;
28pub mod pack_path;
29
30/// File magic, used by loader to detect if content might not be a `pack`.
31pub const PACK_FILE_MAGIC: u64 = 0x479a01809f24813c;
32/// File version, used by loader to detect if loader and packer versions are
33/// compatible.
34pub const PACK_FILE_VERSION: u64 = 2;