1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! # datapress-client
//!
//! Async + blocking Rust client for a running [DataPress] dataset server.
//!
//! It wraps the JSON and Arrow IPC HTTP endpoints so you don't have to
//! hand-roll request bodies and response decoding. The crate is
//! deliberately lightweight: only `reqwest` + `serde` by default, with
//! Arrow IPC decoding behind the (default-on) `arrow` feature and a
//! synchronous client behind the `blocking` feature.
//!
//! ## Async
//!
//! ```no_run
//! # async fn run() -> datapress_client::Result<()> {
//! use datapress_client::{Client, QueryRequest, Predicate};
//!
//! let client = Client::new("http://127.0.0.1:8000")?;
//! let names = client.datasets().await?;
//!
//! let req = QueryRequest::builder()
//! .columns(["State", "Severity"])
//! .predicate(Predicate::new("Severity", "gte", 3))
//! .page_size(10_000)
//! .build();
//! let resp = client.query_json("accidents", &req).await?;
//! println!("{} rows", resp.data.len());
//! # Ok(())
//! # }
//! ```
//!
//! ## Blocking (feature `blocking`)
//!
//! ```no_run
//! # #[cfg(feature = "blocking")]
//! # fn run() -> datapress_client::Result<()> {
//! use datapress_client::blocking::Client;
//!
//! let client = Client::new("http://127.0.0.1:8000")?;
//! let count = client.count("accidents", &[])?;
//! println!("{count} rows");
//! # Ok(())
//! # }
//! ```
//!
//! [DataPress]: https://github.com/jeroenflvr/datapress
pub use ;
pub use ;
pub use ;
pub use decode_ipc_stream;