From 9cb582a10d35a3cc1d0a30c9e389af7e49bea256 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Sun, 30 Jul 2023 17:08:47 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20improve=20code=20documentat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/parser.rs | 1 + src/engines/duckduckgo.rs | 1 + src/engines/searx.rs | 1 + src/results/aggregator.rs | 1 + 4 files changed, 4 insertions(+) diff --git a/src/config/parser.rs b/src/config/parser.rs index 9fec470..a665246 100644 --- a/src/config/parser.rs +++ b/src/config/parser.rs @@ -22,6 +22,7 @@ static CONFIG_FILE_NAME: &str = "config.lua"; /// * `logging` - It stores the option to whether enable or disable logs. /// * `debug` - It stores the option to whether enable or disable debug mode. /// * `upstream_search_engines` - It stores all the engine names that were enabled by the user. +/// * `request_timeout` - It stores the time (secs) which controls the server request timeout. #[derive(Clone)] pub struct Config { pub port: u16, diff --git a/src/engines/duckduckgo.rs b/src/engines/duckduckgo.rs index 8059b90..487e120 100644 --- a/src/engines/duckduckgo.rs +++ b/src/engines/duckduckgo.rs @@ -29,6 +29,7 @@ impl SearchEngine for DuckDuckGo { /// * `query` - Takes the user provided query to query to the upstream search engine with. /// * `page` - Takes an u32 as an argument. /// * `user_agent` - Takes a random user agent string as an argument. + /// * `request_timeout` - Takes a time (secs) as a value which controls the server request timeout. /// /// # Errors /// diff --git a/src/engines/searx.rs b/src/engines/searx.rs index 6e5aa33..5fd7354 100644 --- a/src/engines/searx.rs +++ b/src/engines/searx.rs @@ -27,6 +27,7 @@ impl SearchEngine for Searx { /// * `query` - Takes the user provided query to query to the upstream search engine with. /// * `page` - Takes an u32 as an argument. /// * `user_agent` - Takes a random user agent string as an argument. + /// * `request_timeout` - Takes a time (secs) as a value which controls the server request timeout. /// /// # Errors /// diff --git a/src/results/aggregator.rs b/src/results/aggregator.rs index b7ad050..b8d7346 100644 --- a/src/results/aggregator.rs +++ b/src/results/aggregator.rs @@ -51,6 +51,7 @@ type FutureVec = Vec, Report< /// * `random_delay` - Accepts a boolean value to add a random delay before making the request. /// * `debug` - Accepts a boolean value to enable or disable debug mode option. /// * `upstream_search_engines` - Accepts a vector of search engine names which was selected by the +/// * `request_timeout` - Accepts a time (secs) as a value which controls the server request timeout. /// user through the UI or the config file. /// /// # Error