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::encoded::shape::RowShape;
5
6use super::{ringbuffer::RingBuffer, table::Table, view::View};
7use crate::row::row_shape_from_columns;
8
9pub trait GetShape {
10	fn get_shape(&self) -> RowShape;
11}
12
13impl GetShape for Table {
14	fn get_shape(&self) -> RowShape {
15		row_shape_from_columns(&self.columns)
16	}
17}
18
19impl GetShape for View {
20	fn get_shape(&self) -> RowShape {
21		row_shape_from_columns(self.columns())
22	}
23}
24
25impl GetShape for RingBuffer {
26	fn get_shape(&self) -> RowShape {
27		row_shape_from_columns(&self.columns)
28	}
29}