pub struct RelatedQueries {
pub client: Client,
}Fields§
§client: ClientImplementations§
Source§impl RelatedQueries
impl RelatedQueries
Sourcepub fn new(client: Client) -> Self
pub fn new(client: Client) -> Self
Create a RelatedQueries Instance.
Returns a RelatedQueries instance
Examples found in repository?
More examples
examples/filter.rs (line 16)
3fn main() {
4 let keywords = Keywords::new(vec!["Pasta"]);
5 let country = Country::IT;
6
7 // Set response lang to french and search on Google Image
8 let lang = Lang::FR;
9 let property = Property::Web;
10
11 let client = Client::new(keywords, country)
12 .with_lang(lang)
13 .with_property(property)
14 .with_category(Category::FoodAndDrink)
15 .build();
16 let related_queries = RelatedQueries::new(client).get();
17 println!("{}", related_queries);
18}Sourcepub fn get(&self) -> Value
pub fn get(&self) -> Value
Retrieve Queries data for all keywords.
Retrieve data for all keywords set within the client.
Returns a JSON serde Value (serde_json::Value).
§Example
let keywords = Keywords::new(vec!["Github vs Gitlab"]);
let country = Country::ALL;
let client = Client::new(keywords, country).build();
let related_queries = RelatedQueries::new(client).get();
println!("{}", related_queries);§Panics
Panic if the client have not been built.
ⓘ
let keywords = Keywords::new(vec!["Github vs Gitlab"]);
let country = Country::ALL;
let client = Client::new(keywords, country);
let related_queries = RelatedQueries::new(client).get();Examples found in repository?
More examples
examples/filter.rs (line 16)
3fn main() {
4 let keywords = Keywords::new(vec!["Pasta"]);
5 let country = Country::IT;
6
7 // Set response lang to french and search on Google Image
8 let lang = Lang::FR;
9 let property = Property::Web;
10
11 let client = Client::new(keywords, country)
12 .with_lang(lang)
13 .with_property(property)
14 .with_category(Category::FoodAndDrink)
15 .build();
16 let related_queries = RelatedQueries::new(client).get();
17 println!("{}", related_queries);
18}Sourcepub fn get_for(&self, keyword: &str) -> Value
pub fn get_for(&self, keyword: &str) -> Value
Retrieve Queries data for a specific keywords.
Retrieve data for a specific keyword set within the client.
Returns a JSON serde Value (serde_json::Value).
let keywords = Keywords::new(vec!["Github", "Gitlab"]);
let country = Country::ALL;
let client = Client::new(keywords, country).build();
let related_queries = RelatedQueries::new(client).get_for("Gitlab");
println!("{}", related_queries);§Panics
Will panic if input keyword have not been set previously for the client.
ⓘ
let keywords = Keywords::new(vec!["PS4","XBOX","PC"]);
let country = Country::ALL;
let client = Client::new(keywords, country).build();
let region_interest = RelatedQueries::new(client).get_for("WII");Trait Implementations§
Source§impl Clone for RelatedQueries
impl Clone for RelatedQueries
Source§fn clone(&self) -> RelatedQueries
fn clone(&self) -> RelatedQueries
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RelatedQueries
impl Debug for RelatedQueries
Source§impl Default for RelatedQueries
impl Default for RelatedQueries
Source§fn default() -> RelatedQueries
fn default() -> RelatedQueries
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RelatedQueries
impl !RefUnwindSafe for RelatedQueries
impl Send for RelatedQueries
impl Sync for RelatedQueries
impl Unpin for RelatedQueries
impl !UnwindSafe for RelatedQueries
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more