Struct http_file_headers::Config [−][src]
pub struct Config { /* fields omitted */ }
A configuration with the builder interface
Methods
impl Config
[src]
impl Config
pub fn new() -> Config
[src]
pub fn new() -> Config
New configuration with default values
Defaults:
text_charset("utf-8")
- no index files
encodings_on_text_files()
- etags, last-modified and conditions based on them are enabled
- content-type is enabled
pub fn text_charset(&mut self, charset: &str) -> &mut Self
[src]
pub fn text_charset(&mut self, charset: &str) -> &mut Self
Set default charset for all text mime types
Note: by default it's utf-8
, you may disable it using
no_text_charset()
pub fn no_text_charset(&mut self) -> &mut Self
[src]
pub fn no_text_charset(&mut self) -> &mut Self
Disable adding charset value to all text mime types
pub fn add_index_file(&mut self, name: &str) -> &mut Self
[src]
pub fn add_index_file(&mut self, name: &str) -> &mut Self
Add a name of the file used as the directory index, like index.html
Multiple names can be added. They are probed in the order in which they are defined here. Also, these filenames with encoding extensions are tried too.
pub fn no_encodings(&mut self) -> &mut Self
[src]
pub fn no_encodings(&mut self) -> &mut Self
Do not search for .br
and .gz
files
pub fn encodings_on_text_files(&mut self) -> &mut Self
[src]
pub fn encodings_on_text_files(&mut self) -> &mut Self
Search for .br
and .gz
files for text files
Text files re those having text/*
mime type
or application/javascript
pub fn encodings_on_all_files(&mut self) -> &mut Self
[src]
pub fn encodings_on_all_files(&mut self) -> &mut Self
Search for .br
and .gz
files for all files regardless of mime type
pub fn content_type(&mut self, value: bool) -> &mut Self
[src]
pub fn content_type(&mut self, value: bool) -> &mut Self
Togggles generation of Content-Type header (so user can override)
By default it's enabled
pub fn etag(&mut self, value: bool) -> &mut Self
[src]
pub fn etag(&mut self, value: bool) -> &mut Self
Toggles generation of Etag generation (and so If-None-Match
too)
By default it's enabled
pub fn last_modified(&mut self, value: bool) -> &mut Self
[src]
pub fn last_modified(&mut self, value: bool) -> &mut Self
Toggles generation of Last-Modified (and so If-Modified-Since
too)
Note: Last-Modified date is never sent if date is earlier than 1990-01-01.
pub fn done(&self) -> Arc<Config>
[src]
pub fn done(&self) -> Arc<Config>
Finalize configuration and wrap into an Arc
Trait Implementations
impl Clone for Config
[src]
impl Clone for Config
fn clone(&self) -> Config
[src]
fn clone(&self) -> Config
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Config
[src]
impl Debug for Config