reifydb-core 0.4.11

Core database interfaces and data structures for ReifyDB
Documentation
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2025 ReifyDB

use reifydb_type::{
	storage::DataBitVec,
	value::{
		identity::IdentityId,
		uuid::{Uuid4, Uuid7},
	},
};

use crate::value::column::{data::ColumnData, push::Push};

impl Push<Uuid4> for ColumnData {
	fn push(&mut self, value: Uuid4) {
		match self {
			ColumnData::Uuid4(container) => container.push(value),
			ColumnData::Option {
				inner,
				bitvec,
			} => {
				inner.push(value);
				DataBitVec::push(bitvec, true);
			}
			other => {
				panic!(
					"called `push::<Uuid4>()` on incompatible EngineColumnData::{:?}",
					other.get_type()
				);
			}
		}
	}
}

impl Push<Uuid7> for ColumnData {
	fn push(&mut self, value: Uuid7) {
		match self {
			ColumnData::Uuid7(container) => container.push(value),
			ColumnData::Option {
				inner,
				bitvec,
			} => {
				inner.push(value);
				DataBitVec::push(bitvec, true);
			}
			other => {
				panic!(
					"called `push::<Uuid7>()` on incompatible EngineColumnData::{:?}",
					other.get_type()
				);
			}
		}
	}
}

impl Push<IdentityId> for ColumnData {
	fn push(&mut self, value: IdentityId) {
		match self {
			ColumnData::IdentityId(container) => container.push(value),
			ColumnData::Option {
				inner,
				bitvec,
			} => {
				inner.push(value);
				DataBitVec::push(bitvec, true);
			}
			other => {
				panic!(
					"called `push::<IdentityId>()` on incompatible EngineColumnData::{:?}",
					other.get_type()
				);
			}
		}
	}
}