Expand description
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
Modules§
- endpoints
- API endpoint implementation
- types
- Types needed for working with the API, as described in API documentation
Structs§
- Client
- USGS EROS M2M API client. This is the main interaction point with the API. The instantiation needs valid user credentials that are used to initiate a session and get an API token. The token is automatically freed when the Client goes out of scope.
Enums§
- Error
- Error type of this crate
Constants§
- ENVVAR_
PASS - Defines the environment variable for the USGS password
- ENVVAR_
USER - Defines the environment variable for the USGS username
- USGS_
API_ URL - Defines the USGS EROS M2M API url to use
Type Aliases§
- Result
- Result type of this crate