Skip to main content

reifydb_core/interface/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4//! Cross-crate trait surface. Each submodule defines the contract for one subsystem of the database.
5//!
6//! Each submodule exposes the traits and value types that downstream crates implement and consume - covering the
7//! catalog, authentication, storage, evaluation, dataflow, change-data-capture, change-records, qualified identifiers,
8//! name-resolution results, and component versions. The `WithEventBus` trait at the top level is implemented by
9//! anything that owns or borrows the in-process event bus, so handler code can publish without holding a direct
10//! reference.
11//!
12//! Invariant: traits in this module are object-safe wherever a downstream crate handles them as `dyn Trait`. The
13//! supervision and wiring layer holds erased references to storage backends, evaluators, and catalog stores;
14//! introducing a generic, an `async fn`, or a `Self`-typed return on such a trait silently breaks every consumer at the
15//! next compile.
16
17use crate::event::EventBus;
18
19pub mod auth;
20pub mod catalog;
21pub mod cdc;
22pub mod change;
23pub mod consolidate;
24pub mod evaluate;
25pub mod flow;
26pub mod identifier;
27pub mod resolved;
28pub mod store;
29pub mod subscription;
30pub mod version;
31
32pub trait WithEventBus {
33	fn event_bus(&self) -> &EventBus;
34}