Skip to main content

Geocoder

Trait Geocoder 

Source
pub trait Geocoder: Send + Sync {
    // Required methods
    fn geocode<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        options: &'life2 GeocodeOptions,
    ) -> Pin<Box<dyn Future<Output = EveryMapResult<SearchResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn reverse_geocode<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        coordinate: &'life1 Coordinate,
        options: &'life2 ReverseGeocodeOptions,
    ) -> Pin<Box<dyn Future<Output = EveryMapResult<SearchResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Core trait for geocoding and search providers.

This trait covers the portable search domain:

  • Forward geocoding (address → coordinates)
  • Reverse geocoding (coordinates → address)

Provider-specific capabilities (e.g., HERE’s discover and autosuggest) are available through extension traits in provider crates.

Required Methods§

Source

fn geocode<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, options: &'life2 GeocodeOptions, ) -> Pin<Box<dyn Future<Output = EveryMapResult<SearchResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn reverse_geocode<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, coordinate: &'life1 Coordinate, options: &'life2 ReverseGeocodeOptions, ) -> Pin<Box<dyn Future<Output = EveryMapResult<SearchResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§