wabot_core/lib.rs
1//! # wabot-core
2//!
3//! Core foundations of the Wabot framework — the Rust port of
4//! `@wabot-dev/framework`'s `src/core/*` layer.
5//!
6//! What lives here:
7//!
8//! * [`injection`] — DI container (`tsyringe` analogue).
9//! * [`storable`] — generic, serde-enforced data container.
10//! * [`entity`] — Storable + identity, timestamps, soft-delete.
11//! * [`description`] — human-readable metadata for AI tool schemas.
12//! * [`validation`] — declarative, introspectable validators.
13//!
14//! Higher layers (`feature/*`, `addon/*`) build on this crate and on the
15//! `wabot-macros` proc-macro crate which provides `#[singleton]`,
16//! `#[injectable]`, `#[derive(Validate)]`, `#[description("…")]`, etc.
17
18#[cfg(feature = "async-context")]
19pub mod audit;
20pub mod auth;
21pub mod config;
22pub mod description;
23pub mod entity;
24pub mod env;
25pub mod idempotency;
26pub mod injection;
27/// Who caused a change. Rides the [`log_context`], so it needs the
28/// same `async-context` feature.
29#[cfg(feature = "async-context")]
30pub mod lifecycle;
31pub mod lock;
32/// Correlation fields that follow a unit of work across `.await`
33/// points. Behind the `async-context` feature (on by default) because
34/// it is the one part of core that needs a task-local, and so an async
35/// runtime — see the note in CLAUDE.md about keeping core
36/// runtime-free.
37#[cfg(feature = "async-context")]
38pub mod log_context;
39pub mod mapper;
40pub mod password;
41pub mod random;
42pub mod rate_limit;
43pub mod repository;
44pub mod storable;
45pub mod validation;
46
47/// One-stop import for the foundation types most consumers need.
48pub mod prelude {
49 pub use crate::auth::{Auth, AuthError};
50 pub use crate::description::{DescriptionEntry, DescriptionRegistry};
51 pub use crate::entity::{Entity, EntityData, EntityError, EntityFields};
52 pub use crate::injection::{Container, InjectionError};
53 pub use crate::lock::{Locker, LockerExt};
54 pub use crate::password::{self, PasswordError};
55 pub use crate::random;
56 pub use crate::storable::Storable;
57 pub use crate::validation::{
58 validators, Constraint, FieldType, ModelInfo, ModelValidationError, PropertyInfo, Validate,
59 ValidationError,
60 };
61}