pub struct GeocodeBuilder { /* private fields */ }
Expand description

Represents a reverse_geocode 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 reverse_geocode_url.

Implementations§

source§

impl GeocodeBuilder

source

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

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.).”

source

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

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.

source

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

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.

This value has a default value of 20, which is also its maximum. If zero or a number greater than 20 is passed here, it will be defaulted to 20 before sending to Twitter.

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

source

pub async fn call(&self, token: &Token) -> Result<Response<SearchResult>, Error>

Finalize the search parameters and return the results collection.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere
    V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
    S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more