geosuggest-utils

Crates.iogeosuggest-utils
lib.rsgeosuggest-utils
version0.6.4
sourcesrc
created_at2023-08-18 18:50:15.118997
updated_at2024-09-20 11:20:54.53646
descriptionGeosuggest index update utilities
homepage
repositoryhttps://github.com/estin/geosuggest.git
max_upload_size
id948113
size72,245
Evgeniy Tatarkin (estin)

documentation

https://docs.rs/geosuggest-utils/

README

geosuggest-utils

HTTP service

Examples

Usage example

use tokio;
use anyhow::Result;

use geosuggest_utils::{IndexUpdater, IndexUpdaterSettings};

#[tokio::main]
async fn main() -> Result<()> {
    println!("Build index...");
    let updater = IndexUpdater::new(IndexUpdaterSettings {
        names: None, // no multilang support
        ..Default::default()
    })?;

    let engine = updater.build().await?;

    println!(
        "Suggest result: {:#?}",
        engine.suggest::<&str>("Beverley", 1, None, Some(&["us"]))
    );
    println!(
        "Reverse result: {:#?}",
        engine.reverse::<&str>((11.138298, 57.510973), 1, None, None)
    );

    Ok(())
}
Commit count: 132

cargo fmt