[−][src]Trait http_fs::config::StaticFileConfig
Configuration description
Associated Types
type FileService: FileServeConfig + 'static
File serve configuration
type DirService: DirectoryListingConfig
Directory serve configuration
Provided methods
fn is_method_allowed(method: &Method) -> bool
Returns whether specified method is allowed for use.
By default allows HEAD
and GET
fn serve_dir(&self) -> &Path
Returns directory from where to serve files.
By default returns .
fn index_file(&self, _path: &Path) -> Option<&Path>
Returns name of index file to show.
path
points to directory relative to StaticFileConfig::serve_dir
.
By default returns None
fn handle_directory(&self, _path: &Path) -> bool
Returns whether directory should be listed on access
path
points to directory relative to StaticFileConfig::serve_dir
.
By default returns false
fn handle_not_found(
&self,
_path: &Path,
_out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)
&self,
_path: &Path,
_out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)
Handles entry that hasn't been found.
path
points to entry relative to StaticFileConfig::serve_dir
.
By default prepares empty NotFound
response with empty body
fn thread_pool_builder() -> ThreadPool
Describes how to get instance of threadpool::ThreadPool
By default sets prefix http-fs
and leaves everything else by default
Implementors
impl StaticFileConfig for DefaultConfig
[src]
type FileService = Self
type DirService = Self
fn is_method_allowed(method: &Method) -> bool
[src]
fn serve_dir(&self) -> &Path
[src]
fn index_file(&self, _path: &Path) -> Option<&Path>
[src]
fn handle_directory(&self, _path: &Path) -> bool
[src]
fn handle_not_found(
&self,
_path: &Path,
_out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)
[src]
&self,
_path: &Path,
_out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)