Skip to main content

reifydb_core/value/column/
headers.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2// Copyright (c) 2025 ReifyDB
3
4use reifydb_type::fragment::Fragment;
5
6use crate::value::column::columns::Columns;
7
8#[derive(Debug, Clone)]
9pub struct ColumnHeaders {
10	pub columns: Vec<Fragment>,
11}
12
13impl ColumnHeaders {
14	pub fn from_columns(columns: &Columns) -> Self {
15		Self {
16			columns: columns.iter().map(|c| c.name().clone()).collect(),
17		}
18	}
19
20	pub fn empty() -> Self {
21		Self {
22			columns: Vec::new(),
23		}
24	}
25}