Skip to main content

reifydb_core/interface/catalog/
layout.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4use reifydb_codec::row::shape::{RowFamily, RowShape};
5
6use super::{ringbuffer::RingBuffer, table::Table, view::View};
7use crate::row::row_shape_from_columns;
8
9pub trait GetRowShape {
10	fn get_row_shape(&self) -> RowShape;
11}
12
13impl GetRowShape for Table {
14	fn get_row_shape(&self) -> RowShape {
15		row_shape_from_columns(RowFamily::Table, &self.columns)
16	}
17}
18
19impl GetRowShape for View {
20	fn get_row_shape(&self) -> RowShape {
21		row_shape_from_columns(self.storage_kind().row_family(), self.columns())
22	}
23}
24
25impl GetRowShape for RingBuffer {
26	fn get_row_shape(&self) -> RowShape {
27		row_shape_from_columns(RowFamily::RingBuffer, &self.columns)
28	}
29}