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

Builder for SearchQuery.

Implementations§

source§

impl SearchQueryBuilder

source

pub fn location_query(&mut self, value: LocationQuery) -> &mut Self

source

pub fn address_details(&mut self, value: bool) -> &mut Self

Include a breakdown of the address into elements

source

pub fn extra_tags(&mut self, value: bool) -> &mut Self

Include additional information if the result is available

source

pub fn name_details(&mut self, value: bool) -> &mut Self

Include a list of alternative names in the results. This may include language variants, references, operator and brand.

source

pub fn accept_language(&mut self, value: Option<Vec<String>>) -> &mut Self

Preferred language order for showing search results, overrides the value specified in the “Accept-Languague” HTTP header. Either use a standard RFC2616 accept-language string or a simple comma-separated list of language codes.

source

pub fn country_codes(&mut self, value: Option<Vec<String>>) -> &mut Self

Include addition information if the result is available Limit search results to one of more countries. The country code must be the ISO-3166-1alpha2 code, e.g. gb for the United Kingdom, de for Germany.

Each place in Nominatim is assigned to one country code based of OSM country borders. In rare cases a place may not be in any country at all, for example, in international waters.

source

pub fn exclude_place_ids(&mut self, value: Option<Vec<u64>>) -> &mut Self

If you do not want certain OSM objects to appear in the search result, give a comma separated list of the place_ids you want to skip. This can be used to retrieve additional search results. For example, if a previous query only returned a few results, then including those here would cause the search to return other, less accurate, matches (if possible.)

source

pub fn limit(&mut self, value: Option<u8>) -> &mut Self

Limits the number of returned results. (Default: 10, Maximum: 50.)

source

pub fn viewbox(&mut self, value: Option<[f64; 4]>) -> &mut Self

The preferred area to find search results. Any two corner points of the box are accepted as long as they span a real box.

viewbox=<x1>,<y1>,<x2>,<y2>
source

pub fn dedupe(&mut self, value: bool) -> &mut Self

Sometimes you have several objects in OSM identifying the same place or object in reality. The simplest case is a street being split into many different OSM ways due to different characteristics. Nominatim will attempt to detect such duplicates and only return on match unless this parameter is set to false. (Default: true),

source

pub fn build(&self) -> Result<SearchQuery, SearchQueryBuilderError>

Builds a new SearchQuery.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for SearchQueryBuilder

source§

fn clone(&self) -> SearchQueryBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SearchQueryBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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