Struct espresso::config::PathConfig
source · pub struct PathConfig {
pub matcher: PathMatcherConfig,
pub mime_disposition: Option<HashMap<String, ContentDispositionConfig>>,
pub set_etag: Option<bool>,
pub set_last_modified: Option<bool>,
pub index_strategy: Option<IndexStrategyConfig>,
pub headers: Option<HashMap<String, String>>,
pub not_found_path: Option<PathBuf>,
}
Expand description
Per-path configuration.
Server configuration that can be set depending on the current path.
Fields
matcher: PathMatcherConfig
Specifies how the path should be matched.
mime_disposition: Option<HashMap<String, ContentDispositionConfig>>
Optional overrides for the Content-Disposition header on some Mime types.
set_etag: Option<bool>
Specifies whether the server should compute ETags and include them in the response.
Note: This only applies to file resources.
set_last_modified: Option<bool>
Specifies whether the server should include a Last-Modified
header in
responses.
Note: This only applies to file resources.
index_strategy: Option<IndexStrategyConfig>
Specifies how the server should handle directory paths.
headers: Option<HashMap<String, String>>
Specifies additional headers to include as part of the response.
not_found_path: Option<PathBuf>
Specifies the file that the server should return when the specified path can’t be found.
If not specified, the server will return a 404 response with no body.
Trait Implementations
sourceimpl Clone for PathConfig
impl Clone for PathConfig
sourcefn clone(&self) -> PathConfig
fn clone(&self) -> PathConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PathConfig
impl Debug for PathConfig
sourceimpl<'de> Deserialize<'de> for PathConfig
impl<'de> Deserialize<'de> for PathConfig
sourcefn 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
sourceimpl PartialEq<PathConfig> for PathConfig
impl PartialEq<PathConfig> for PathConfig
sourcefn eq(&self, other: &PathConfig) -> bool
fn eq(&self, other: &PathConfig) -> bool
sourceimpl Serialize for PathConfig
impl Serialize for PathConfig
sourceimpl TryFrom<&PathConfig> for PathContext
impl TryFrom<&PathConfig> for PathContext
impl StructuralPartialEq for PathConfig
Auto Trait Implementations
impl RefUnwindSafe for PathConfig
impl Send for PathConfig
impl Sync for PathConfig
impl Unpin for PathConfig
impl UnwindSafe for PathConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more