usgs_eros_client/lib.rs
1//! An API client for [USGS EROS M2M](https://m2m.cr.usgs.gov/api/docs)
2//!
3//! # Example
4//!
5//! Cargo.toml:
6//! ```toml
7//! [dependencies]
8//!usgs-eros-client = "^1.0"
9//!tokio = {version = "^0.2", features = ["macros"]}
10//! ```
11//!
12//! Basic functionality:
13//! ```no_run
14//! use usgs_eros_client::{Client, Result};
15//! use usgs_eros_client::types::Credentials;
16//! use usgs_eros_client::endpoints::DatasetRequestBuilder;
17//!
18//! #[tokio::main]
19//!async fn main() -> Result<()> {
20//! let credentials = Credentials::from_env()?;
21//! let client = Client::new(&credentials).await?;
22//! let dataset = client.dataset()
23//! .name("gls_all").call().await?;
24//! println!("Dataset response: {:?}", dataset);
25//! Ok(())
26//!}
27//! ```
28//!
29//! For implemented API endpoints, see the methods implemented on the [Client](struct.Client.html#impl)
30
31mod client;
32mod constants;
33mod error;
34
35pub mod endpoints;
36pub mod types;
37
38pub use client::Client;
39pub use error::{Error, Result};
40// Make sure the relevant consts appear in documentation
41pub use constants::{ENVVAR_PASS, ENVVAR_USER, USGS_API_URL};