diff --git a/src/models/aggregation_models.rs b/src/models/aggregation_models.rs index 656297f..72bbf08 100644 --- a/src/models/aggregation_models.rs +++ b/src/models/aggregation_models.rs @@ -122,6 +122,11 @@ pub struct SearchResults { /// search query was filtered when the safe search level set to 3 and it /// was present in the `Blocklist` file. pub filtered: bool, + /// Stores the safe search level `safesearch` provided in the search url. + pub safe_search_level: u8, + /// Stores the flag option which holds the check value that whether any search engines were + /// selected or not. + pub no_engines_selected: bool, } impl SearchResults { @@ -147,6 +152,8 @@ impl SearchResults { engine_errors_info: engine_errors_info.to_owned(), disallowed: Default::default(), filtered: Default::default(), + safe_search_level: Default::default(), + no_engines_selected: Default::default(), } } @@ -178,4 +185,19 @@ impl SearchResults { pub fn results(&mut self) -> Vec { self.results.clone() } + + /// A setter function to set the current page safe search level. + pub fn set_safe_search_level(&mut self, safe_search_level: u8) { + self.safe_search_level = safe_search_level; + } + + /// A getter function that gets the value of `no_engines_selected`. + pub fn no_engines_selected(&self) -> bool { + self.no_engines_selected + } + + /// A setter function to set the `no_engines_selected` to true. + pub fn set_no_engines_selected(&mut self) { + self.no_engines_selected = true; + } }