lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

prepare_query.rs (578B)


      1 use radroots_geonames::asset::official_asset_spec;
      2 use radroots_geonames::{Point, Query};
      3 
      4 fn main() -> Result<(), radroots_geonames::Error> {
      5     let spec = official_asset_spec();
      6     let locality = Query::locality("Victoria")?
      7         .with_region("BC")?
      8         .with_country("CA")?
      9         .with_limit(5)?;
     10     let reverse = Query::reverse(Point::new(48.4284, -123.3656)?).with_radius_degrees(0.25)?;
     11 
     12     println!(
     13         "prepared asset {} and query limits {}/{} without I/O",
     14         spec.version(),
     15         locality.limit(),
     16         reverse.limit()
     17     );
     18     Ok(())
     19 }