Skip to main content

reddb_types/
lib.rs

1//! `reddb-io-types` — the neutral keystone crate for RedDB's logical type
2//! system (ADR 0052).
3//!
4//! This crate sits at the **bottom of the workspace crate graph**: every
5//! authority crate (`reddb-io-file`, `reddb-io-wire`, the planned
6//! `reddb-io-rql` and `reddb-io-crypto`) may depend on it, but it depends on
7//! **no other workspace crate**. It owns the core type vocabulary —
8//! [`Value`], [`DataType`], [`SqlTypeName`], [`TypeModifier`],
9//! [`TypeCategory`], [`ValueError`], and [`Row`] — together with the
10//! [`value_codec`] serialization that `Value::to_bytes`/`from_bytes` delegate
11//! to.
12//!
13//! The `reddb-server` `storage::schema` module no longer re-exports this
14//! vocabulary; every server, test, and driver call site names this crate
15//! directly.
16
17// The byte-faithful re-home (ADR 0052) preserves `types`/`value_codec`
18// exactly as they were authored under the server's crate-level
19// `#![allow(unused_imports)]`. `types.rs` keeps `std::net::{Ipv4Addr,
20// Ipv6Addr}` in its module-level `use` even though the non-test paths
21// reference them fully-qualified and the test module re-imports them
22// locally; carrying the allow here keeps the move a pure relocation.
23#![allow(clippy::unwrap_used)]
24#![allow(unused_imports)]
25// Legacy allow for the too_many_lines ratchet (PRD #1252): pre-existing
26// codec/type functions exceed the 120-line threshold. The lint bites on
27// new/changed code; remove once those functions are split up.
28#![allow(clippy::too_many_lines)]
29// Legacy allow for the cast_possible_truncation ratchet (PRD #1252):
30// pre-existing codec/coercion functions truncate via `as` on lengths and
31// numeric narrowing. The lint bites on new/changed code; remove once those
32// casts become explicit checked conversions.
33#![allow(clippy::cast_possible_truncation)]
34
35pub mod canonical_key;
36pub mod cast_catalog;
37pub mod catalog;
38pub mod coerce;
39pub mod coercion_spine;
40mod conversions;
41pub mod distance;
42pub mod document_body_codec;
43pub mod duration;
44pub mod encoding;
45pub mod function_catalog;
46pub mod index_hint;
47pub mod json;
48pub mod key_dictionary;
49pub mod knowledge;
50pub mod operator;
51pub mod operator_catalog;
52pub mod parametric;
53pub mod polymorphic;
54pub mod queue_mode;
55pub mod serde_json;
56pub mod table;
57pub mod types;
58pub mod utils;
59pub mod value_codec;
60pub mod value_compare;
61pub mod value_json;
62pub mod vector_metadata;
63
64pub use canonical_key::{value_to_canonical_key, CanonicalKey, CanonicalKeyFamily};
65pub use operator::BinOp;
66pub use table::{
67    ColumnDef, Constraint, ConstraintType, IndexDef, IndexType, TableDef, TableDefError,
68};
69pub use types::{DataType, Row, SqlTypeName, TypeCategory, TypeModifier, Value, ValueError};