Struct ddg::query::Query
[−]
[src]
pub struct Query<'a> { /* fields omitted */ }
A Builder struct for making the query.
Methods
impl<'a> Query<'a>
[src]
fn new<I: Into<Cow<'a, str>>>(query: I, name: I) -> Self
Constructs a new query object, requiring the query, and the name of your app. It is recommended to use a constant for the name of your app.
use ddg::Query; const APP_NAME: &'static str = "ddg_example_app"; let query = Query::new("Rust", APP_NAME); let response = query.execute().unwrap();
fn no_html(self) -> Self
Will strip out any HTML content from the text in the Response eg.(italics, bolds, etc)
use ddg::Query; const APP_NAME: &'static str = "ddg_example_app"; let query = Query::new("Rust", APP_NAME).no_html(); let response = query.execute().unwrap();
fn skip_disambig(self) -> Self
Skip the D(Disambiguation) type of Instant Answer.
fn execute(self) -> Result<Response, Error>
Execute the request and parses it into a DdgResponse
struct.
Trait Implementations
impl<'a> Clone for Query<'a>
[src]
fn clone(&self) -> Query<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more