pub struct Request<'a> { /* private fields */ }Expand description
Google Trend request
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn new(
comparison_item: Vec<ComparaisonElem<'a>>,
category: Category,
property: Property,
) -> Result<Self, Error>
pub fn new( comparison_item: Vec<ComparaisonElem<'a>>, 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: "rust",
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<'a> Freeze for Request<'a>
impl<'a> RefUnwindSafe for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnwindSafe for Request<'a>
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