uk_police_api/lib.rs
1//! # uk-police-api
2//!
3//! An async Rust client for the [UK Police API](https://data.police.uk/docs/).
4//!
5//! # Example
6//!
7//! ```no_run
8//! use uk_police_api::{Client, Area, Coordinate};
9//!
10//! # #[tokio::main]
11//! # async fn main() -> Result<(), uk_police_api::Error> {
12//! let client = Client::new();
13//!
14//! // What crimes happened near Big Ben last month?
15//! let area = Area::Point(Coordinate { lat: 51.5007, lng: -0.1246 });
16//! let crimes = client.street_level_crimes("all-crime", &area, None).await?;
17//! # Ok(())
18//! # }
19//! ```
20
21mod client;
22mod error;
23pub mod models;
24
25pub use client::Client;
26pub use error::Error;
27pub use models::{
28 Area, ContactDetails, Coordinate, Crime, CrimeCategory, CrimeLastUpdated, CrimeOutcome,
29 CrimeOutcomes, EngagementMethod, Force, ForceDetail, LatLng, Link, LocateNeighbourhoodResult,
30 Location, Neighbourhood, NeighbourhoodDetail, NeighbourhoodEvent, NeighbourhoodLocation,
31 NeighbourhoodPriority, Outcome, OutcomeCategory, OutcomeDetail, OutcomeObject, OutcomeStatus,
32 SeniorOfficer, StopAndSearch, StopAndSearchType, Street,
33};