Struct rtrend::related_queries::RelatedQueries
source · pub struct RelatedQueries {
pub client: Client,
}
Fields§
§client: Client
Implementations§
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)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
fn main() {
let keywords = Keywords::new(vec!["Pasta"]);
let country = Country::IT;
// Set response lang to french and search on Google Image
let lang = Lang::FR;
let property = Property::Web;
let client = Client::new(keywords, country)
.with_lang(lang)
.with_property(property)
.with_category(Category::FoodAndDrink)
.build();
let related_queries = RelatedQueries::new(client).get();
println!("{}", related_queries);
}
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)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
fn main() {
let keywords = Keywords::new(vec!["Pasta"]);
let country = Country::IT;
// Set response lang to french and search on Google Image
let lang = Lang::FR;
let property = Property::Web;
let client = Client::new(keywords, country)
.with_lang(lang)
.with_property(property)
.with_category(Category::FoodAndDrink)
.build();
let related_queries = RelatedQueries::new(client).get();
println!("{}", related_queries);
}
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 copy 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 !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