reifydb_core/interface/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 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 evaluate;
24pub mod flow;
25pub mod identifier;
26pub mod resolved;
27pub mod store;
28pub mod version;
29
30pub trait WithEventBus {
31 fn event_bus(&self) -> &EventBus;
32}