Archived
d1ec384b27
- crates/ → engrams/ (Rust engrams live here) - bindings/ → receptors/ (cross-language access points into the graph) - Cargo.toml workspace paths updated
20 lines
847 B
Rust
20 lines
847 B
Rust
/// Shared application state for all request handlers.
|
|
use engram_core::EngramDb;
|
|
use engram_projection::registry::ProjectionRegistry;
|
|
use engram_sync::SyncEngine;
|
|
use engram_tx::TransactionEngine;
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
pub struct AppState {
|
|
/// Local database — uses std::sync::Mutex (sync ops only, fast)
|
|
pub db: Arc<Mutex<EngramDb>>,
|
|
/// Sync engine — uses tokio::sync::Mutex so it can be held across .await
|
|
pub sync_engine: Arc<tokio::sync::Mutex<SyncEngine>>,
|
|
/// API key used to authenticate incoming sync requests
|
|
pub api_key: String,
|
|
/// Projection registry — named schema views over the activation surface
|
|
pub projection_registry: Arc<Mutex<ProjectionRegistry>>,
|
|
/// Transaction engine — append-only command log with rollback support
|
|
pub tx_engine: Arc<Mutex<TransactionEngine>>,
|
|
}
|