[][src]Module vial::asset

Functions

as_reader

Produces a boxed io::Read for an asset.

etag

Produce an etag for an asset.

exists

Does the asset exist on disk? path is the path relative to ASSET_DIR ex: asset::exists("index.html") checks for "./static/index.html" if ASSET_DIR is set to static. Works both in regular mode and bundle mode.

is_bundled

Have assets been bundled into the binary?

normalize_path

Cleans a path of tricky things like .. and puts it in a format we can use in other asset functions.

read

Read an asset to u8.

to_string

Like fs::read_to_string(), but with an asset.