pub struct AssetsConfig {Show 14 fields
pub dir_path: Option<String>,
pub base_route: String,
pub append_index_html: Option<bool>,
pub skip_base_route_index_html: Option<bool>,
pub append_html_ext: Option<bool>,
pub preserve_exif: Option<bool>,
pub html_csp: Option<HttpCsp>,
pub http: Option<HttpCache>,
pub precompression: Option<CompressionAlgorithms>,
pub internal_precompression: Option<ArrayVec<CompressionAlgorithm, 4>>,
pub minify_css: Option<bool>,
pub minify_js: Option<bool>,
pub minify_html: Option<bool>,
pub internal_cache_control_header_value: Option<String>,
}Fields§
§dir_path: Option<String>Relative path to assets directory.
base_route: StringNote: must start with a / and cannot end with a / unless
/ is the entire route.
append_index_html: Option<bool>whether to add index.html to the base route
and the end of routes having a trailing slash
or missing an extension.
i.e. https://example.com/static, https://example.com/static/,
https://example.com/static/{*path}/ and https://example.com/static/{*path}
(with no extension) would return the contents of
/static/index.html or /static/{*path}/index.html.
primarily useful when serving a generated static site.
Note: cannot be used with append_index_ext
skip_base_route_index_html: Option<bool>whether the {base_route} and {base_route}/ routes should
skip returning the index.html at the root of the static dir.
useful when the static dir base_route is set to / but you’d
like to have a template use the / route.
append_html_ext: Option<bool>whether to append .html to routes that do not
include an extension.
i.e. https://example.com/static/about would return the contents of
/static/about.html.
primarily useful when serving a generated static site.
Note: cannot be used with append_index_html
preserve_exif: Option<bool>will not strip the exif data from images.
Important: only use if you want all metadata (including location data) on your photos.
html_csp: Option<HttpCsp>content security policy for HTML assets
http: Option<HttpCache>HTTP cache configuration.
TODO: provide a way to pattern match files for which to apply TODO: specific cache controls.
precompression: Option<CompressionAlgorithms>Which encodings to use when precompressing assets.
Serving priority is dictated by specified order.
internal_precompression: Option<ArrayVec<CompressionAlgorithm, 4>>§minify_css: Option<bool>Determines whether CSS files should be minified, prior to write.
minify_js: Option<bool>Determines whether JS files should be minified, prior to write.
minify_html: Option<bool>Determines whether HTML files should be minified, prior to write.
internal_cache_control_header_value: Option<String>Implementations§
Trait Implementations§
Source§impl Clone for AssetsConfig
impl Clone for AssetsConfig
Source§fn clone(&self) -> AssetsConfig
fn clone(&self) -> AssetsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more