pub struct StaticFilesConf {
pub root: Option<PathBuf>,
pub canonicalize_uri: bool,
pub index_file: OneOrMany<String>,
pub page_404: Option<String>,
pub precompressed: OneOrMany<CompressionAlgorithm>,
pub declare_charset: String,
pub declare_charset_types: OneOrMany<MimeMatch>,
}
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/.
index_file: OneOrMany<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: OneOrMany<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).
declare_charset: String
The character set to declare for text files.
declare_charset_types: OneOrMany<MimeMatch>
List of MIME types that the declare_charset
setting should apply to.
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 Clone for StaticFilesConf
impl Clone for StaticFilesConf
Source§fn clone(&self) -> StaticFilesConf
fn clone(&self) -> StaticFilesConf
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StaticFilesConf
impl Debug for StaticFilesConf
Source§impl Default for StaticFilesConf
impl Default for StaticFilesConf
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.