Skip to main content

reifydb_sub_server/
format.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4//! Wire format for query/command/subscription responses.
5
6use serde::{Deserialize, Serialize};
7
8/// The three response formats the server can emit.
9///
10/// - `Json`  — rows-shape JSON: `[[{col: val, ...}, ...], ...]` (one inner array per frame)
11/// - `Frames` — frames-shape JSON: `{frames: [ResponseFrame, ...]}` with columnar payloads
12/// - `Rbcf`  — frames-shape binary, RBCF-encoded
13#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
14#[serde(rename_all = "lowercase")]
15pub enum WireFormat {
16	Json,
17	#[default]
18	Frames,
19	Rbcf,
20}