vizier-rs
A basic VizieR client for rust
Allows easy, type-safe access to VizieR TAP APIs to query a wide variety of astronomical catalogues using ADQL.
Installation
Run $ cargo add vizier-adql, or add vizier-adql = "0.1.1" to Cargo.toml under [dependencies].
Basic, untyped usage
use Client;
use Value;
// 1. Create a client
let client = default;
// 2. Execute queries
let objects = client
.
.await
.unwrap;
// ...
Client::default() will use http://tapvizier.u-strasbg.fr/TAPVizieR/tap/sync as the TAP endpoint. If you need to specify a different endpoint, use Client::new("your_endpoint_url").
Sync/Async
If you don't want to use async, enable the is_sync feature on the crate. The API won't change, except that Client::query now blocks and returns the value directly.
Typed usage
To strictly parse the response, create a struct resembling an element from the response and derive Deserialize for it.
Then, query and parse like so:
let objects = client
.
.await
.unwrap;
// ...