pub struct StaticFilesConf {
pub root: Option<PathBuf>,
pub canonicalize_uri: bool,
pub redirect_prefix: Option<String>,
pub index_file: Vec<String>,
pub page_404: Option<String>,
pub precompressed: Vec<CompressionAlgorithm>,
}
Expand description
Configuration file settings of the static files module
Fields§
§root: Option<PathBuf>
The root directory.
canonicalize_uri: bool
Redirect /file%2e.txt to /file.txt and /dir to /dir/.
redirect_prefix: Option<String>
When canonicalize_uri
is used, prefix redirect targets with the given string. This is
useful when the static files handler is applied to a subdirectory of the actual webspace.
index_file: Vec<String>
List of index files to look for in a directory.
page_404: Option<String>
URI path of the page to display instead of the default Not Found page, e.g. /404.html
precompressed: Vec<CompressionAlgorithm>
List of file extensions to check when looking for pre-compressed versions of a file. Supported file extensions are gz (gzip), zz (zlib deflate), z (compress), br (Brotli), zst (Zstandard).
Implementations§
Source§impl StaticFilesConf
impl StaticFilesConf
Sourcepub fn merge_with_opt(&mut self, opt: StaticFilesOpt)
pub fn merge_with_opt(&mut self, opt: StaticFilesOpt)
Merges the command line options into the current configuration. Any command line options present overwrite existing settings.
Trait Implementations§
Source§impl Debug for StaticFilesConf
impl Debug for StaticFilesConf
Source§impl Default for StaticFilesConf
impl Default for StaticFilesConf
Source§impl<'de> Deserialize<'de> for StaticFilesConfwhere
StaticFilesConf: Default,
impl<'de> Deserialize<'de> for StaticFilesConfwhere
StaticFilesConf: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StaticFilesConf
impl PartialEq for StaticFilesConf
Source§impl TryFrom<StaticFilesConf> for StaticFilesHandler
impl TryFrom<StaticFilesConf> for StaticFilesHandler
impl Eq for StaticFilesConf
impl StructuralPartialEq for StaticFilesConf
Auto Trait Implementations§
impl Freeze for StaticFilesConf
impl RefUnwindSafe for StaticFilesConf
impl Send for StaticFilesConf
impl Sync for StaticFilesConf
impl Unpin for StaticFilesConf
impl UnwindSafe for StaticFilesConf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.