3 releases
0.1.2 | Feb 7, 2023 |
---|---|
0.1.1 | Feb 7, 2023 |
0.1.0 | Feb 7, 2023 |
#6 in #commercial
10KB
93 lines
C02 API Basic Rust Implementation
DONE:
- Basic API implementation
- Client Format
- Two C02 request implementations.
TODO:
- Rate Limitation
- Support of future Electricity Maps commercial API
Example:
use rust_c02_signal;
async fn do_stuff() -> () {
let c02client = rust_c02_signal::Client::new("API-KEY".to_string());
// Get the latest data for a country code
let resp = c02client.latest_cc("GB".to_string()).await;
println!("{:?}", resp);
// Get the latest data for a set of long/lat coords
let resp = c02client.latest_gc(51.5074, 0.1278).await;
println!("{:?}", resp);
}
Dependencies
~8–19MB
~273K SLoC