Skip to main content

hypersync_client_solana/
types.rs

1use std::collections::BTreeMap;
2
3use arrow::record_batch::RecordBatch;
4use hypersync_solana_net_types::RollbackGuard;
5
6/// Response from a single query to the HyperSync server.
7pub struct QueryResponse {
8    /// The next slot to query from (for pagination).
9    pub next_slot: u64,
10    /// Reorg guard describing the server's in-memory head window, when the
11    /// server has one to report.
12    pub rollback_guard: Option<RollbackGuard>,
13    /// Named Arrow tables (e.g. "blocks", "transactions", "instruction_calls").
14    pub data: ArrowResponseData,
15    /// Number of bytes in the raw response (for adaptive batch sizing).
16    pub response_bytes: usize,
17}
18
19/// Arrow record batches keyed by table name.
20pub struct ArrowResponseData {
21    pub tables: BTreeMap<&'static str, RecordBatch>,
22}