diff options
author | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-02-13 18:13:34 +0000 |
---|---|---|
committer | boasting-squirrel <boasting.squirrel@gmail.com> | 2019-02-13 18:13:34 +0000 |
commit | 3e2c3341ee4fd540126f822ef23aa442508cf4b6 (patch) | |
tree | c29d8f7f3d120b6a01b15c848af48fba356e307d /src/main.rs | |
parent | Removed config.rs and put back actix config in main.rs (diff) | |
download | miniserve-3e2c3341ee4fd540126f822ef23aa442508cf4b6.tar.gz miniserve-3e2c3341ee4fd540126f822ef23aa442508cf4b6.zip |
Added some docstrings
Diffstat (limited to '')
-rw-r--r-- | src/main.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 080124d..7c31976 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,16 +12,36 @@ mod auth; mod listing; #[derive(Clone, Debug)] +/// Configuration of the Miniserve application pub struct MiniserveConfig { + /// Enable verbose mode pub verbose: bool, + + /// Path to be served by miniserve pub path: std::path::PathBuf, + + /// Port on which miniserve will be listening pub port: u16, + + /// IP address(es) on which miniserve will be available pub interfaces: Vec<IpAddr>, + + /// Enable HTTP basic authentication pub auth: Option<auth::BasicAuthParams>, + + /// If false, miniserve will serve the current working directory pub path_explicitly_chosen: bool, + + /// Enable symlink resolution pub no_symlinks: bool, + + /// Enable random route generation pub random_route: Option<String>, + + /// Sort files/directories pub sort_method: listing::SortingMethods, + + /// Enable inverse sorting pub reverse_sort: bool, } @@ -152,7 +172,8 @@ fn main() { let _ = sys.run(); } -pub fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { +/// Configures the Actix application +fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { let s = { let path = &app.state().path; let no_symlinks = app.state().no_symlinks; |