pub struct Request { /* private fields */ }
Expand description
Google Trend request
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(
comparison_item: Vec<ComparaisonElem>,
category: Category,
property: Property,
) -> Result<Self, Error>
pub fn new( comparison_item: Vec<ComparaisonElem>, category: Category, property: Property, ) -> Result<Self, Error>
Examples found in repository?
examples/simple_request.rs (lines 8-16)
7async fn main() {
8 let simple_request = Request::new(
9 vec![ComparaisonElem {
10 keyword: "cough".to_string(),
11 geo: Country::ALL,
12 time: Period::Predefined(PredefinedPeriod::OneYear),
13 }],
14 Category::RespiratoryConditions,
15 Property::Web,
16 )
17 .unwrap();
18
19 let client = TrendsClient::try_default().await.unwrap();
20 let explore_client = client.explore(simple_request).await.unwrap();
21
22 let stats = explore_client
23 .get_timeseries(WidgetKeyword::All)
24 .await
25 .unwrap();
26
27 println!("{:?}", stats);
28}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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