mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-22 14:08:23 -05:00
✨ feat: add new check value for no engine selected (#227)
This commit is contained in:
parent
9271090851
commit
b428cedd7a
@ -122,6 +122,11 @@ pub struct SearchResults {
|
|||||||
/// search query was filtered when the safe search level set to 3 and it
|
/// search query was filtered when the safe search level set to 3 and it
|
||||||
/// was present in the `Blocklist` file.
|
/// was present in the `Blocklist` file.
|
||||||
pub filtered: bool,
|
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 {
|
impl SearchResults {
|
||||||
@ -147,6 +152,8 @@ impl SearchResults {
|
|||||||
engine_errors_info: engine_errors_info.to_owned(),
|
engine_errors_info: engine_errors_info.to_owned(),
|
||||||
disallowed: Default::default(),
|
disallowed: Default::default(),
|
||||||
filtered: 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<SearchResult> {
|
pub fn results(&mut self) -> Vec<SearchResult> {
|
||||||
self.results.clone()
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user