pub struct AssetsConfig {Show 15 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, 5>>,
pub minify_css: Option<bool>,
pub minify_js: Option<bool>,
pub minify_html: Option<bool>,
pub internal_cache_control_header_value: Option<String>,
pub middlewares: Option<Vec<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, 5>>§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>§middlewares: Option<Vec<String>>list of names of middleware to include for the assets
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 moreSource§impl ComposeSchema for AssetsConfig
Available on crate feature utoipa only.
impl ComposeSchema for AssetsConfig
utoipa only.Source§impl Debug for AssetsConfig
impl Debug for AssetsConfig
Source§impl Default for AssetsConfig
impl Default for AssetsConfig
Source§fn default() -> AssetsConfig
fn default() -> AssetsConfig
Source§impl<'de> Deserialize<'de> for AssetsConfig
impl<'de> Deserialize<'de> for AssetsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AssetsConfig
Available on crate feature docs only.
impl JsonSchema for AssetsConfig
docs only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more