Expand description
§Reinhardt Core
Core components for the Reinhardt framework, providing fundamental types, exception handling, signals, macros, security, and validation utilities.
§Available Validators
The validators crate provides comprehensive validation utilities:
- IPAddressValidator: IPv4/IPv6 address validation
- PhoneNumberValidator: International phone number validation (E.164)
- CreditCardValidator: Credit card validation with Luhn algorithm
- IBANValidator: International bank account number validation
- ColorValidator: Hex, RGB, HSL color validation
- FileTypeValidator: MIME type and extension validation
- CustomRegexValidator: User-defined regex pattern validation
§Related Backend Crates
Backend integrations live in focused crates rather than in reinhardt-core.
See reinhardt-db, reinhardt-auth, reinhardt-mail,
reinhardt-tasks, and reinhardt-utils for database, auth, mail,
queue, cache, and storage integrations.
§Quick Start
use reinhardt_core::exception::{Error, ErrorKind};
// Create a typed application error
let err = Error::NotFound("Resource not found".to_string());
assert_eq!(err.kind(), ErrorKind::NotFound);§Architecture
Key modules in this crate:
exception: Typed error hierarchy for HTTP and application-level errorstypes: Fundamental types (URL, money, phone number, color, coordinates)signals: Django-style signal/slot system for decoupled event handlingsecurity: CSRF, XSS prevention, security headers, HSTS, IP filtering, redirect validation, and resource limitsvalidators: Comprehensive input validation (IP, IBAN, phone, credit card)serializers: Data serialization and deserialization frameworkpagination: Cursor, page number, and limit-offset pagination strategies- [
parsers]: Request body parsing (JSON, form, multipart) negotiation: HTTP content negotiation utilities
With the reactive feature, explicit batch() calls defer layout and passive
effects until the outermost batch exits, then flush layout work before passive
consumers while preserving write order within each timing. Layout effects remain
synchronous outside batches. Callback writes stay batched through the complete flush
and deduplicate against pending callbacks, preserving complete form reset snapshots.
§Feature Flags
| Feature | Default | Description |
|---|---|---|
types | enabled | Core type definitions |
exception | enabled | Error hierarchy and HTTP status mapping |
signals | enabled | Async signal/slot system |
macros | enabled | Procedural macros re-export |
security | enabled | CSRF, XSS prevention, headers, HSTS, IP filtering, redirects, and resource limits |
validators | enabled | Comprehensive input validation |
serializers | enabled | Data serialization framework |
parsers | disabled | Request body parsers |
pagination | disabled | Pagination strategies |
negotiation | disabled | HTTP content negotiation |
messages | disabled | Flash message storage |
page | disabled | Server-side page rendering types (enables security) |
reactive | disabled | Reactive state management |
serde | disabled | Serde serialization support |
json | disabled | JSON serialization support |
xml | disabled | XML serialization support |
yaml | disabled | YAML serialization support |
parallel | disabled | Parallel processing with Rayon |
i18n | disabled | Internationalization with Fluent |
Re-exports§
pub use apply_update::ApplyUpdate;pub use crate::rate_limit::RateLimitStrategy;pub use reinhardt_macros as macros;pub use tokio;
Modules§
- apply_
update - Trait for applying partial updates to target structs.
- endpoint
- HTTP endpoint routing and handler registration. Endpoint metadata trait for HTTP Method Macros
- exception
- Error types and exception handling.
- model_
info - Target-neutral metadata traits emitted by model macros.
- rate_
limit - Rate limiting strategies. Rate limiting types and strategies.
- security
- Security utilities (CSRF, XSS prevention, headers, HSTS, IP filtering, redirects, and resource limits).
- serde
- Re-export of serde serialization types and serde_json.
- serializers
- Data serialization framework.
- signals
- Signal/event dispatch system.
- types
- Core type definitions. Core type definitions and common types for the Reinhardt framework.
- validators
- Field and data validators. Advanced validators for Reinhardt
- ws
- WebSocket routing primitives shared across reinhardt crates. WebSocket routing primitives shared across reinhardt crates.
Macros§
- connect_
receiver - Helper macro for connecting receivers with a simpler syntax