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 document_body_codec;
42pub mod duration;
43pub mod function_catalog;
44pub mod index_hint;
45pub mod json;
46pub mod key_dictionary;
47pub mod knowledge;
48pub mod operator;
49pub mod operator_catalog;
50pub mod parametric;
51pub mod polymorphic;
52pub mod queue_mode;
53pub mod serde_json;
54pub mod types;
55pub mod utils;
56pub mod value_codec;
57pub mod value_compare;
58pub mod vector_metadata;
59
60pub use canonical_key::{value_to_canonical_key, CanonicalKey, CanonicalKeyFamily};
61pub use operator::BinOp;
62pub use types::{DataType, Row, SqlTypeName, TypeCategory, TypeModifier, Value, ValueError};