lib

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

lib.rs (916B)


      1 //! Deterministic GeoNames asset management and locality lookup.
      2 //!
      3 //! This crate never chooses runtime paths or performs work during
      4 //! construction. Hosts explicitly provide every asset source and destination.
      5 //!
      6 //! # Inert query construction
      7 //!
      8 //! ```
      9 //! use radroots_geonames::{Point, Query};
     10 //!
     11 //! let locality = Query::locality("Victoria")?
     12 //!     .with_region("BC")?
     13 //!     .with_country("CA")?;
     14 //! assert_eq!(locality.limit(), 10);
     15 //!
     16 //! let reverse = Query::reverse(Point::new(48.4284, -123.3656)?)
     17 //!     .with_radius_degrees(0.25)?;
     18 //! assert_eq!(reverse.limit(), 1);
     19 //! # Ok::<(), radroots_geonames::Error>(())
     20 //! ```
     21 
     22 #![forbid(unsafe_code)]
     23 
     24 pub mod asset;
     25 pub mod database;
     26 pub mod download;
     27 mod error;
     28 pub mod model;
     29 pub mod query;
     30 
     31 pub use asset::{AssetSpec, AssetStatus};
     32 pub use database::Geocoder;
     33 pub use error::Error;
     34 pub use model::{Candidate, Point};
     35 pub use query::Query;