Macro trillium_static_compiled::static_compiled

source ·
macro_rules! static_compiled {
    ($path:tt) => { ... };
}
Expand description

The preferred interface to build a StaticCompiledHandler

Macro interface to build a StaticCompiledHandler. static_compiled!("assets") is identical to StaticCompiledHandler::new(root!("assets")).

This takes one argument, which must be a string literal.

§Relative paths

Relative paths are expanded and canonicalized relative to $CARGO_MANIFEST_DIR, which is usually the directory that contains your Cargo.toml. If compiled within a workspace, this will be the subcrate’s Cargo.toml.

§Environment variable expansion

If the argument to static_compiled contains substrings that are formatted like an environment variable, beginning with a $, they will be interpreted in the compile time environment.

For example “$OUT_DIR/some_directory” will expand to the directory some_directory within the env variable $OUT_DIR set by cargo. See this link for further documentation on the environment variables set by cargo.