3 unstable releases
0.2.0 | Mar 6, 2021 |
---|---|
0.1.1 | Apr 12, 2020 |
0.1.0 | Nov 16, 2019 |
#7 in #picture
11KB
184 lines
apod-async-client
apod-async-client
is a crate providing a simple client for NASA "Astronomy
Picture of the Day" API.
The client is based on reqwest and tokio, and requires the tokio reactor to be setup in your application.
use apod_async_client::{APODClient, APODClientError, Date};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), APODClientError> {
let client = APODClient::new("DEMO_KEY");
let (metadata, rate_limit) = client.get_picture(&Date::Today, true).await?;
Ok(())
}
This crate is quite simple, but allowed me to exercise the following points :
Dependencies
~4–16MB
~221K SLoC