cruxi 0.1.0

Minimal, transport-agnostic hexagonal architecture framework
Documentation
//! # Cruxi
//!
//! A minimal, transport-agnostic hexagonal architecture framework for Rust.
//!
//! Cruxi implements the Ports & Adapters pattern with a 4-layer architecture:
//!
//! ```text
//! ┌──────────────────────────────────────┐
//! │ INBOUND TRANSPORTS                   │
//! │ (HTTP, gRPC, MQTT, TCP)              │
//! └──────────────────────────────────────┘
//!//! ┌──────────────────────────────────────┐
//! │ HANDLER (Inbound Adapter)            │
//! │ • Receives requests                  │
//! │ • Validates transport format         │
//! │ • Delegates to Service               │
//! └──────────────────────────────────────┘
//!//! ┌──────────────────────────────────────┐
//! │ SERVICE (Application Layer)          │
//! │ • Business logic orchestration       │
//! │ • Authorization checks               │
//! │ • Coordinates Repositories           │
//! └──────────────────────────────────────┘
//!//! ┌──────────────────────────────────────┐
//! │ REPOSITORY (Domain Layer)            │
//! │ • Domain validation                  │
//! │ • Transactional integrity            │
//! │ • Calls Providers                    │
//! └──────────────────────────────────────┘
//!//! ┌──────────────────────────────────────┐
//! │ PROVIDER (Infrastructure)            │
//! │ • Database I/O                       │
//! │ • HTTP API calls                     │
//! │ • Message queues                     │
//! └──────────────────────────────────────┘
//! ```
//!
//! ## Design Principles
//!
//! - **Zero external dependencies** in the core (only std + thiserror)
//! - **Generic type safety** via trait generics on Req/Resp
//! - **Pattern matching** for all control flow and error handling
//! - **No `.unwrap()`** - explicit error handling throughout
//!
//! ## Features
//!
//! - `async` - Enables async trait variants (requires `async-trait`)

#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![deny(clippy::unwrap_used)]
#![deny(clippy::expect_used)]
#![warn(clippy::pedantic)]

mod context;
mod error;
mod handler;
mod provider;
mod repository;
mod service;
mod urn;
mod validator;

pub use context::{Context, ContextBuilder, Extensions, TransportAs};
pub use error::{CodedError, CruxiError, ValidationError};
pub use handler::{Handler, HandlerFn, ValidatingHandler, ValidatingHandlerError};
pub use provider::{Provider, ProviderFn};
pub use repository::{
    NoTransaction, Repository, RepositoryFn, Transaction, TxError, ValidatingRepository,
    ValidatingRepositoryError,
};
pub use service::{Service, ServiceFn};
pub use urn::{Urn, UrnError};
pub use validator::{FailValidator, PassValidator, Validator, ValidatorFn};

#[cfg(feature = "async")]
pub use handler::AsyncHandler;
#[cfg(feature = "async")]
pub use provider::AsyncProvider;
#[cfg(feature = "async")]
pub use repository::AsyncRepository;
#[cfg(feature = "async")]
pub use service::AsyncService;
#[cfg(feature = "async")]
pub use validator::AsyncValidator;