aimdb_core/
lib.rs

1//! AimDB Core Database Engine
2//!
3//! # aimdb-core
4//!
5//! Type-safe, async in-memory database for data synchronization
6//! across MCU → edge → cloud environments.
7//!
8//! # Architecture
9//!
10//! - **Type-Safe Records**: `TypeId`-based routing, no string keys
11//! - **Unified API**: Single `Database<A>` type for all operations
12//! - **Runtime Agnostic**: Works with Tokio (std) or Embassy (embedded)
13//! - **Producer-Consumer**: Built-in typed message passing
14//!
15//! See examples in the repository for usage patterns.
16
17#![cfg_attr(not(feature = "std"), no_std)]
18
19pub mod buffer;
20pub mod builder;
21pub mod connector;
22pub mod context;
23pub mod database;
24mod error;
25pub mod ext_macros;
26#[cfg(feature = "std")]
27pub mod remote;
28pub mod router;
29pub mod time;
30pub mod transport;
31pub mod typed_api;
32pub mod typed_record;
33
34// Public API exports
35pub use context::RuntimeContext;
36pub use error::{DbError, DbResult};
37
38// Runtime trait re-exports from aimdb-executor
39// These traits define the platform-specific execution, timing, and logging capabilities
40pub use aimdb_executor::{
41    ExecutorError, ExecutorResult, Logger, Runtime, RuntimeAdapter, RuntimeInfo, Spawn, TimeOps,
42};
43
44// Database implementation exports
45pub use database::Database;
46
47// Producer-Consumer Pattern exports
48pub use builder::{AimDb, AimDbBuilder};
49pub use connector::ConnectorBuilder;
50pub use transport::{Connector, ConnectorConfig, PublishError};
51pub use typed_api::{Consumer, Producer, RecordRegistrar, RecordT};
52pub use typed_record::{AnyRecord, AnyRecordExt, TypedRecord};
53
54// Connector Infrastructure exports
55pub use connector::{ConnectorClient, ConnectorLink, ConnectorUrl, SerializeError};
56
57// Router exports for connector implementations
58pub use router::{Route, Router, RouterBuilder};