FindPlace

Struct FindPlace 

Source
pub struct FindPlace<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> FindPlace<'a>

Source

pub fn new(api_key: &str, client: &'a Client) -> Self

Construct a new FindPlace instance.

§Arguments
  • api_key - The Google Places API key.
  • client - The reqwest client instance.
§Returns

A new instance of FindPlace.

Source

pub fn with_input(&mut self, input: &str) -> &mut FindPlace<'a>

Assign the input string for a FindPlace call.

input -> The input text.

Source

pub fn with_fields( &mut self, fields: HashSet<PlaceSearchPlaceFields>, ) -> &mut FindPlace<'a>

Assign the fields for a FindPlace call.

fields -> The fields parameter.

Source

pub fn with_language(&mut self, language: Language) -> &mut FindPlace<'a>

Assign the language for a FindPlace call.

language -> The language parameter.

Source

pub fn with_location_bias( &mut self, location_bias: LocationBias, ) -> &mut FindPlace<'a>

Assign the location_bias for a FindPlace call.

location_bias -> The location_bias parameter.

Source

pub fn with_input_type(&mut self, input_type: &str) -> &mut FindPlace<'a>

Assign the input_type for a FindPlace call.

input_type -> The input_type parameter.

Source

pub async fn execute(&mut self) -> Option<&mut FindPlace<'a>>

Execute the call in an asynchronous fashion.

Source

pub fn iter(&mut self) -> FindPlaceIterator<'_, 'a>

This function returns an iterator (FindPlaceIterator) over the places in a FindPlace object. The iterator is initialized to start at the first place (index 0).

It allows you to iterate over the places in the FindPlace result without having to manually keep track of the index.

For example, you can use it like this:

Source

pub fn at(&self, index: usize) -> Option<&PlaceSearchPlace>

Retrieve the place at the specified index.

index -> The index of the place to retrieve.

Returns an Option with the place if it exists, or None if the index is out of range.

Source

pub fn get_result(&self) -> FindPlaceSearchResult

Auto Trait Implementations§

§

impl<'a> Freeze for FindPlace<'a>

§

impl<'a> !RefUnwindSafe for FindPlace<'a>

§

impl<'a> Send for FindPlace<'a>

§

impl<'a> Sync for FindPlace<'a>

§

impl<'a> Unpin for FindPlace<'a>

§

impl<'a> !UnwindSafe for FindPlace<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

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 T
where U: From<T>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,