10 unstable releases (3 breaking)

0.4.3 Apr 15, 2019
0.4.2 Apr 13, 2019
0.4.0 Mar 29, 2019
0.3.1 Jan 7, 2019
0.1.2 Jan 20, 2018
Download history 15/week @ 2023-10-22 29/week @ 2023-10-29 13/week @ 2023-11-05 13/week @ 2023-11-12 19/week @ 2023-11-19 66/week @ 2023-11-26 7/week @ 2023-12-03 31/week @ 2023-12-10 12/week @ 2023-12-17 31/week @ 2023-12-24 7/week @ 2023-12-31 11/week @ 2024-01-07 14/week @ 2024-01-14 26/week @ 2024-01-21 57/week @ 2024-01-28 11/week @ 2024-02-04

110 downloads per month
Used in backslash-z

MIT/Apache

21KB
313 lines

airkorea-rs

circleci crate.io docs.rs License: MIT License: Apache-2.0

Airkorea Crawler written in Rust.

Usage

use {airkorea, futures::prelude::*, tokio::runtime::Runtime};

let mut rt = Runtime::new();

let status = rt.block_on(airkorea::search(lng, lat))?;

println!("Station address: {}", status.station_address);
println!("Time: {}", status.time);
for pollutant in status {
    println!("{}", pollutant);
}

Testing

You can override Airkorea Url for mock testing. If you want to write unit tests for some functions using airkorea, just set AIRKOREA_URL environment variable to desired mock server.

spawn_server("localhost:1234");

std::env::set_var("AIRKOREA_URL", "http://localhost:1234");

let status = rt.block_on(airkorea::search(123.123, 456.456)).unwrap();

assert_eq!(&status.station_address, "Foobar Station");

Dependencies

~24MB
~516K SLoC