kora_core/lib.rs
1//! # kora-core
2//!
3//! Core data structures, shard engine, and memory management for Kōra.
4//!
5//! This crate has **zero** workspace dependencies — it sits at the bottom of
6//! the workspace dependency graph and every other Kōra crate builds on top of
7//! it. The main abstractions are:
8//!
9//! - `types::Value` — the polymorphic value representation (inline strings,
10//! heap strings, integers, lists, sets, hashes, sorted sets, streams, vectors).
11//! - `types::CompactKey` / `types::KeyEntry` — compact key storage with
12//! per-key metadata (TTL, LFU counter, storage tier).
13//! - `shard::ShardStore` — a single-threaded key-value store that executes
14//! commands against its partition of the keyspace.
15//! - `shard::ShardEngine` — coordinates N worker threads, each owning one
16//! `ShardStore`, and routes commands by key hash.
17//! - `command::Command` / `command::CommandResponse` — the full command
18//! vocabulary and response types that bridge the protocol layer and the engine.
19//!
20//! The `simulation` feature gate enables a deterministic simulation testing
21//! framework (see the `sim` module).
22
23#![warn(clippy::all)]
24#![warn(missing_docs)]
25
26/// Core error types.
27pub mod error;
28
29/// Key and value types for the cache engine.
30pub mod types;
31
32/// Command and response types.
33pub mod command;
34
35/// Key hashing and shard routing.
36pub mod hash;
37
38/// Per-thread shard storage and the coordinating engine.
39pub mod shard;
40
41/// Deterministic simulation testing framework.
42#[cfg(any(test, feature = "simulation"))]
43pub mod sim;