[][src]Struct egg_mode::place::SearchBuilder

pub struct SearchBuilder<'a> { /* fields omitted */ }

Represents a location search query before it is sent.

The available methods on this builder struct allow you to specify optional parameters to the search operation. Where applicable, each method lists its default value and acceptable ranges.

To complete your search setup and send the query to Twitter, hand your tokens to call. The list of results from Twitter will be returned, as well as a URL to perform the same search via search_url.

Methods

impl<'a> SearchBuilder<'a>[src]

pub fn accuracy(self, accuracy: Accuracy) -> Self[src]

Expands the area to search to the given radius. By default, this is zero.

From Twitter: "If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.)."

pub fn granularity(self, granularity: PlaceType) -> Self[src]

Sets the minimal specificity of what kind of results to return. For example, passing City to this will make the eventual result exclude neighborhoods and points.

pub fn max_results(self, max_results: u32) -> Self[src]

Restricts the maximum number of results returned in this search. This is not a guarantee that the search will return this many results, but instead provides a hint as to how many "nearby" results to return.

From experimentation, this value has a default of 20 and a maximum of 100. If fewer locations match the search parameters, fewer places will be returned.

From Twitter: "Ideally, only pass in the number of places you intend to display to the user here."

pub fn contained_within(self, contained_id: &'a str) -> Self[src]

Restricts results to those contained within the given Place ID.

pub fn attribute(self, attribute_key: &'a str, attribute_value: &'a str) -> Self[src]

Restricts results to those with the given attribute. A list of common attributes are available in Twitter's documentation for Places. Custom attributes are supported in this search, if you know them. This function may be called multiple times with different attribute_key values to combine attribute search parameters.

For example, .attribute("street_address", "123 Main St") searches for places with the given street address.

pub fn call(&self, token: &Token) -> FutureResponse<SearchResult>[src]

Finalize the search parameters and return the results collection.

Auto Trait Implementations

impl<'a> Send for SearchBuilder<'a>

impl<'a> Sync for SearchBuilder<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Same<T> for T

type Output = T

Should always be Self