Crates.io | geosuggest-utils |
lib.rs | geosuggest-utils |
version | 0.6.4 |
source | src |
created_at | 2023-08-18 18:50:15.118997 |
updated_at | 2024-09-20 11:20:54.53646 |
description | Geosuggest index update utilities |
homepage | |
repository | https://github.com/estin/geosuggest.git |
max_upload_size | |
id | 948113 |
size | 72,245 |
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(())
}