pub struct Customsearch<C, A> { /* fields omitted */ }
Central instance to access all Customsearch related resource activities
Instantiate a new hub
extern crate hyper;
extern crate hyper_rustls;
extern crate yup_oauth2 as oauth2;
extern crate google_customsearch1 as customsearch1;
use customsearch1::{Result, Error};
use std::default::Default;
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
use customsearch1::Customsearch;
let secret: ApplicationSecret = Default::default();
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
<MemoryStorage as Default>::default(), None);
let mut hub = Customsearch::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);
let result = hub.cse().list("q")
.start(53)
.sort("et")
.site_search_filter("consetetur")
.site_search("amet.")
.search_type("voluptua.")
.safe("Lorem")
.rights("gubergren")
.related_site("justo")
.or_terms("sit")
.num(75)
.lr("diam")
.low_range("rebum.")
.link_site("consetetur")
.img_type("sadipscing")
.img_size("vero")
.img_dominant_color("sadipscing")
.img_color_type("invidunt")
.hq("consetetur")
.hl("dolore")
.high_range("duo")
.googlehost("aliquyam")
.gl("Lorem")
.filter("et")
.file_type("clita")
.exclude_terms("consetetur")
.exact_terms("takimata")
.date_restrict("nonumy")
.cx("kasd")
.cr("sanctus")
.c2coff("takimata")
.doit();
match result {
Err(e) => match e {
Error::HttpError(_)
|Error::MissingAPIKey
|Error::MissingToken(_)
|Error::Cancelled
|Error::UploadSizeLimitExceeded(_, _)
|Error::Failure(_)
|Error::BadRequest(_)
|Error::FieldClash(_)
|Error::JsonDecodeError(_, _) => println!("{}", e),
},
Ok(res) => println!("Success: {:?}", res),
}
Set the user-agent header field to use in all requests to the server.
It defaults to google-api-rust-client/1.0.7
.
Returns the previously set user-agent.
Set the base url to use in all requests to the server.
It defaults to https://www.googleapis.com/customsearch/
.
Returns the previously set base url.
Set the root url to use in all requests to the server.
It defaults to https://www.googleapis.com/
.
Returns the previously set root url.