1 unstable release
0.5.0 | Oct 19, 2020 |
---|
#572 in Science
67KB
1K
SLoC
Usgs EROS M2M API Client
An idiomatic Rust API for using the USGS EROS M2M data search and retrieval interface.
Usage
Cargo.toml:
[dependencies]
usgs-eros-client = "^0.5"
tokio = {version = "^0.2", features = ["macros"]}
Basic functionality:
use usgs_eros_client::{Client, Result};
use usgs_eros_client::types::Credentials;
use usgs_eros_client::endpoints::DatasetRequestBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let credentials = Credentials::from_env()?;
let client = Client::new(&credentials).await?;
let dataset = client.dataset()
.name("gls_all").call().await?;
println!("Dataset response: {:?}", dataset);
Ok(())
}
Made by: S&T Norway
lib.rs
:
An API client for USGS EROS M2M
Example
Cargo.toml:
[dependencies]
usgs-eros-client = "^1.0"
tokio = {version = "^0.2", features = ["macros"]}
Basic functionality:
use usgs_eros_client::{Client, Result};
use usgs_eros_client::types::Credentials;
use usgs_eros_client::endpoints::DatasetRequestBuilder;
#[tokio::main]
async fn main() -> Result<()> {
let credentials = Credentials::from_env()?;
let client = Client::new(&credentials).await?;
let dataset = client.dataset()
.name("gls_all").call().await?;
println!("Dataset response: {:?}", dataset);
Ok(())
}
For implemented API endpoints, see the methods implemented on the Client
Dependencies
~4–9MB
~196K SLoC