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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Arrow Flight RPC support for distributed data transfer.
//!
//! This module provides high-performance DataFrame transfer between PandRS
//! processes using the [Apache Arrow Flight](https://arrow.apache.org/docs/format/Flight.html)
//! protocol. It builds on the `arrow-flight` and `tonic` crates to expose a
//! gRPC service that any Arrow Flight client – in Rust, Python, Java, Go, …
//! – can talk to.
//!
//! ## Feature flags
//!
//! | Feature | What it enables |
//! |-------------|--------------------------------------------------------------|
//! | `distributed` | [`conversion`] module (DataFrame ↔ RecordBatch utilities) |
//! | `flight` | [`server`] and [`client`] modules (full gRPC transport) |
//!
//! ## Quick start (server side)
//!
//! ```no_run
//! # #[tokio::main]
//! # async fn main() -> pandrs::Result<()> {
//! use pandrs::distributed::flight::server::PandRsFlightServer;
//! use pandrs::{DataFrame, Series};
//!
//! let mut df = DataFrame::new();
//! df.add_column("x".to_string(),
//! Series::new(vec![1i64, 2, 3], Some("x".to_string()))?.into()).expect("add");
//!
//! let server = PandRsFlightServer::new(50051);
//! server.register_dataframe("my_dataset", &df)?;
//! server.serve().await?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Quick start (client side)
//!
//! ```no_run
//! # #[tokio::main]
//! # async fn main() -> pandrs::Result<()> {
//! use pandrs::distributed::flight::client::PandRsFlightClient;
//!
//! let mut client = PandRsFlightClient::new("http://localhost:50051");
//! client.connect().await?;
//!
//! for name in client.list_datasets().await? {
//! println!("Dataset: {name}");
//! }
//!
//! let df = client.get_dataframe("my_dataset").await?;
//! # Ok(())
//! # }
//! ```
/// DataFrame ↔ Arrow RecordBatch conversion utilities.
///
/// Available whenever the `distributed` feature is enabled.
/// Arrow Flight gRPC server ([`PandRsFlightServer`](server::PandRsFlightServer)).
///
/// Requires the `flight` feature.
/// Arrow Flight gRPC client ([`PandRsFlightClient`](client::PandRsFlightClient)).
///
/// Requires the `flight` feature.
// Re-export the main public types for ergonomic access via the parent module.
pub use PandRsFlightClient;
pub use PandRsFlightServer;
pub use ;