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 keeps a re-export shim so the
14//! ~180 existing call-sites across the workspace stay untouched.
15
16// The byte-faithful re-home (ADR 0052) preserves `types`/`value_codec`
17// exactly as they were authored under the server's crate-level
18// `#![allow(unused_imports)]`. `types.rs` keeps `std::net::{Ipv4Addr,
19// Ipv6Addr}` in its module-level `use` even though the non-test paths
20// reference them fully-qualified and the test module re-imports them
21// locally; carrying the allow here keeps the move a pure relocation.
22#![allow(clippy::unwrap_used)]
23#![allow(unused_imports)]
24// Legacy allow for the too_many_lines ratchet (PRD #1252): pre-existing
25// codec/type functions exceed the 120-line threshold. The lint bites on
26// new/changed code; remove once those functions are split up.
27#![allow(clippy::too_many_lines)]
28// Legacy allow for the cast_possible_truncation ratchet (PRD #1252):
29// pre-existing codec/coercion functions truncate via `as` on lengths and
30// numeric narrowing. The lint bites on new/changed code; remove once those
31// casts become explicit checked conversions.
32#![allow(clippy::cast_possible_truncation)]
33
34pub mod canonical_key;
35pub mod cast_catalog;
36pub mod catalog;
37pub mod coerce;
38pub mod coercion_spine;
39mod conversions;
40pub mod distance;
41pub mod duration;
42pub mod function_catalog;
43pub mod index_hint;
44pub mod json;
45pub mod operator;
46pub mod operator_catalog;
47pub mod parametric;
48pub mod polymorphic;
49pub mod queue_mode;
50pub mod serde_json;
51pub mod types;
52pub mod utils;
53pub mod value_codec;
54pub mod value_compare;
55pub mod vector_metadata;
56
57pub use canonical_key::{value_to_canonical_key, CanonicalKey, CanonicalKeyFamily};
58pub use operator::BinOp;
59pub use types::{DataType, Row, SqlTypeName, TypeCategory, TypeModifier, Value, ValueError};