reifydb_type/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4//! Foundational primitive types shared by every other crate in the workspace - the value enum, type enum, type
5//! constraints, the source-fragment carrier used in diagnostics, the error and diagnostic machinery, and the parameter
6//! binding shape used at the wire boundary. This crate is the bottom of the dependency graph; nothing here depends on
7//! `core` or any other ReifyDB crate.
8//!
9//! Anything that wants a stable representation of a column value, a typed identifier, a parameter list, or a
10//! diagnostic anchor uses this crate. The reason it sits below `core` rather than inside it is to break what would
11//! otherwise be a cycle: `core` itself needs values and diagnostics.
12//!
13//! Invariant: types declared here are wire-stable and on-disk-stable. Adding a variant to `Type` or `Value` is a
14//! workspace-wide change that requires bumping wire-format and storage encodings; rearranging the existing variants
15//! silently corrupts persisted data and cross-version replication.
16
17#![cfg_attr(not(debug_assertions), deny(clippy::disallowed_methods))]
18#![cfg_attr(debug_assertions, warn(clippy::disallowed_methods))]
19#![cfg_attr(not(debug_assertions), deny(warnings))]
20#![allow(clippy::tabs_in_doc_comments)]
21
22pub mod error;
23pub mod fragment;
24pub mod params;
25pub mod storage;
26pub mod util;
27pub mod value;
28
29pub type Result<T> = std::result::Result<T, error::Error>;