Skip to main content

reifydb_core/interface/catalog/
vtable.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4use serde::{Deserialize, Serialize};
5
6use crate::interface::catalog::{column::Column, id::NamespaceId};
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
9pub struct VTableId(pub u64);
10
11impl From<u64> for VTableId {
12	fn from(id: u64) -> Self {
13		VTableId(id)
14	}
15}
16
17impl From<VTableId> for u64 {
18	fn from(id: VTableId) -> u64 {
19		id.0
20	}
21}
22
23impl VTableId {
24	#[inline]
25	pub fn to_u64(self) -> u64 {
26		self.0
27	}
28}
29
30#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
31pub struct VTable {
32	pub id: VTableId,
33
34	pub namespace: NamespaceId,
35
36	pub name: String,
37
38	pub columns: Vec<Column>,
39}