Skip to main content

Crate reinhardt

Crate reinhardt 

Source
Expand description

§Reinhardt

A full-stack API framework for Rust, inspired by Django and Django REST Framework.

Reinhardt provides a complete, batteries-included solution for building production-ready REST APIs with Rust. It follows Rust’s composition patterns instead of Python’s inheritance model, making full use of traits, generics, and zero-cost abstractions.

§Core Principles

  • Composition over Inheritance: Uses Rust’s trait system for composable behavior
  • Type Safety: Leverages Rust’s type system for compile-time guarantees
  • Zero-Cost Abstractions: High-level ergonomics without runtime overhead
  • Async-First: Built on tokio and async/await from the ground up

§Feature Flags

Reinhardt provides flexible feature flags to control compilation and reduce binary size.

§Presets

  • minimal - Core functionality only (routing, DI, params)
  • full (default) - All features enabled
  • standard - Balanced for most projects
  • api-only - REST API without templates/forms
  • graphql-server - GraphQL-focused setup
  • websocket-server - WebSocket-centric setup
  • cli-tools - CLI and background jobs
  • test-utils - Testing utilities

§Fine-grained Control

Fine-grained feature flags for precise control over included functionality:

§Authentication ✅
  • auth-jwt - JWT authentication
  • auth-session - Session-based authentication
  • auth-oauth - OAuth2 support
  • auth-token - Token authentication
§Database Backends ✅
  • db-postgres - PostgreSQL support
  • db-mysql - MySQL support
  • db-sqlite - SQLite support
  • db-cockroachdb - CockroachDB support (distributed transactions)
§Middleware ✅
  • middleware-cors - CORS (Cross-Origin Resource Sharing) middleware
  • middleware-compression - Response compression (Gzip, Brotli)
  • middleware-security - Security headers (HSTS, XSS Protection, etc.)
  • middleware-rate-limit - Rate limiting and throttling

See Cargo.toml feature definitions for detailed documentation.

§Quick Example

use reinhardt::prelude::*;
use serde::{Serialize, Deserialize};
use std::sync::Arc;

// Define your model (using composition, not inheritance)
#[derive(Debug, Clone, Serialize, Deserialize)]
struct User {
    id: Option<i64>,
    username: String,
    email: String,
}

// Implement Model trait
impl Model for User {
    type PrimaryKey = i64;
    fn table_name() -> &'static str { "users" }
    fn primary_key(&self) -> Option<&Self::PrimaryKey> { self.id.as_ref() }
    fn set_primary_key(&mut self, value: Self::PrimaryKey) { self.id = Some(value); }
}

// Create a ViewSet (no inheritance needed!)
let users_viewset = ModelViewSet::<User, JsonSerializer<User>>::new("users");

// Set up routing
let mut router = DefaultRouter::new();
router.register_viewset("users", users_viewset);

// Add middleware using composition
let app = MiddlewareChain::new(Arc::new(router))
    .with_middleware(Arc::new(LoggingMiddleware::new()))
    .with_middleware(Arc::new(CorsMiddleware::permissive()));

Modules§

acceptrest and non-WebAssembly
Accept header parsing
adminadmin and non-WebAssembly
Admin panel functionality
appscore and non-WebAssembly
Application configuration and registry module.
auto_schemaopenapi and non-WebAssembly
Automatic schema generation from Rust types
browsable_apirest and non-WebAssembly
Browsable API for Reinhardt
cacherest and non-WebAssembly
Caching for negotiation results
commandscommands and non-WebAssembly
Management commands for Reinhardt framework
confconf and non-WebAssembly
Configuration and settings module.
configopenapi and non-WebAssembly
OpenAPI configuration for endpoint mounting
corecore and non-WebAssembly
Core framework types and utilities module.
dbdatabase and non-WebAssembly
Database re-exports for Model derive macro generated code.
deeplinkdeeplink and non-WebAssembly
Mobile deep linking module.
dentdeliondentdelion and non-WebAssembly
Plugin system module.
detectorrest and non-WebAssembly
Content-Type detection from request body
didi and non-WebAssembly
Dependency injection module.
dispatchdispatch and non-WebAssembly
Request dispatching module.
encodingrest and non-WebAssembly
Encoding negotiation based on Accept-Encoding header
endpoint_inspectoropenapi and non-WebAssembly
Endpoint Inspector for Function-Based Routes
endpointsopenapi and non-WebAssembly
OpenAPI endpoint handlers for automatic documentation mounting
enum_schemaopenapi and non-WebAssembly
Advanced enum schema generation
filtersrest and non-WebAssembly
Type-safe filtering backends for Reinhardt framework
formsforms and non-WebAssembly
Forms and validation module.
generatoropenapi and non-WebAssembly
OpenAPI schema generator with registry integration
graphqlgraphql and non-WebAssembly
GraphQL API module.
grpcgrpc and non-WebAssembly
gRPC service module.
httpNon-WebAssembly
HTTP request and response types module.
i18ni18n and non-WebAssembly
Internationalization module.
inventory
githubcrates-iodocs-rs
languagerest and non-WebAssembly
Language negotiation based on Accept-Language header
mailmail and non-WebAssembly
Email sending module.
media_typerest and non-WebAssembly
Media type representation
metadatarest and non-WebAssembly
Reinhardt Metadata
middleware(standard or middleware) and non-WebAssembly
Middleware module.
migrationsdatabase and non-WebAssembly
Reinhardt Migrations
negotiationrest and non-WebAssembly
Content negotiation for request/response formats. Content negotiation for Reinhardt
negotiatorrest and non-WebAssembly
Content negotiator
openapiopenapi and non-WebAssembly
OpenAPI 3.0 types with Reinhardt extensions
pagespages
WASM-based reactive frontend framework with SSR
paginationrest and non-WebAssembly
Pagination strategies (page-based, cursor, limit-offset).
param_metadataopenapi and non-WebAssembly
Parameter metadata extraction for OpenAPI schema generation
parsersrest and non-WebAssembly
Request body parsers (JSON, form, multipart, etc.).
preludeNon-WebAssembly
Convenience re-exports of commonly used types (server-side only).
querydatabase and non-WebAssembly
SQL query builder module.
redirectshortcuts and non-WebAssembly
HTTP redirect helpers (temporary and permanent). Redirect shortcut functions
registryopenapi and non-WebAssembly
Schema registry for managing reusable component schemas
restrest and non-WebAssembly
REST API module.
reverseNon-WebAssembly
URL reverse resolution (name-to-URL mapping).
schema_registrationopenapi and non-WebAssembly
Compile-time schema registration infrastructure
serde_attrsopenapi and non-WebAssembly
Serde attributes integration for OpenAPI schema generation
serializersrest and non-WebAssembly
Reinhardt Serializers
serverserver and non-WebAssembly
Server module - HTTP/HTTP2/WebSocket server implementations
shortcutsshortcuts and non-WebAssembly
Shortcut functions for common operations.
swaggeropenapi and non-WebAssembly
Swagger UI integration
taskstasks and non-WebAssembly
Background tasks module.
templatetemplates and non-WebAssembly
Template and rendering module.
testtest and non-WebAssembly
Testing utilities module.
throttlingrest and non-WebAssembly
Rate limiting for Reinhardt framework
urlsNon-WebAssembly
URL routing module.
utilsNon-WebAssembly
Utility functions module.
utoipaopenapi and non-WebAssembly
Want to have your API documented with OpenAPI? But you don’t want to see the trouble with manual yaml or json tweaking? Would like it to be so easy that it would almost be like utopic? Don’t worry utoipa is just there to fill this gap. It aims to do if not all then the most of heavy lifting for you enabling you to focus writing the actual API logic instead of documentation. It aims to be minimal, simple and fast. It uses simple proc macros which you can use to annotate your code to have items documented.
versioningrest and non-WebAssembly
Reinhardt Versioning
viewsNon-WebAssembly
Views module.

Macros§

collect_migrationsdatabase and non-WebAssembly
Collect migrations and register them with the global registry
installed_appscore and non-WebAssembly
Defines installed applications with compile-time validation.
pathNon-WebAssembly
Validates URL path syntax at compile time.

Structs§

APIClienttest and non-WebAssembly
Test client for making API requests
APIRequestFactorytest and non-WebAssembly
Factory for creating test requests
APITestCasetest and non-WebAssembly
Base test case for API testing
Absdatabase and non-WebAssembly
Abs - absolute value
AcceptHeaderVersioningrest and non-WebAssembly
Accept header versioning
ActionNon-WebAssembly
Action metadata
ActionMetadatarest and non-WebAssembly
Action metadata (for POST, PUT, etc.)
AdvancedSettingsDeprecatedconf and non-WebAssembly
Main application settings
Aggregatedatabase and non-WebAssembly
Aggregate expression
AllowAnyauth and non-WebAssembly
AllowAny - grants permission to all requests
Annotationdatabase and non-WebAssembly
Represents an annotation on a QuerySet
AnonRateThrottlerest and non-WebAssembly
Rate throttle for anonymous (unauthenticated) requests.
AnonymousUserauth and non-WebAssembly
Anonymous user - represents a non-authenticated visitor
AppConfigcore and non-WebAssembly
Configuration for a single application
Appscore and non-WebAssembly
Main application registry
Argon2Hasherauth and argon2-hasher
Argon2id password hasher (recommended for new applications)
ArrayBuilderopenapi and non-WebAssembly
Builder for Array with chainable configuration methods to create a new Array.
AuthInfoauth and non-WebAssembly
Lightweight authentication extractor that reads from request extensions.
AuthUserauth and non-WebAssembly
Authenticated user extractor that loads the full user model from database.
AuthenticationMiddlewaresessions and middleware and non-WebAssembly
Authentication middleware Extracts user information from session and attaches it to request extensions
BTreeIndexdatabase and non-WebAssembly
B-Tree index (default)
BaseNegotiatorrest and non-WebAssembly
Base content negotiation implementation (abstract)
Body(minimal or standard or di) and non-WebAssembly
Extract the raw request body as bytes
BoundFieldforms and non-WebAssembly
BoundField represents a field bound to form data
CacheKeyBuildercache and non-WebAssembly
Cache key builder for generating cache keys
CacheMiddlewaremiddleware and non-WebAssembly
Cache Middleware
CacheSessionBackendsessions and non-WebAssembly
Cache-based session backend
CacheSettingsconf and non-WebAssembly
Cache settings
Castdatabase and non-WebAssembly
Cast expression - convert a value to a specific type
Ceildatabase and non-WebAssembly
Ceil - round up to nearest integer
CharFieldforms and non-WebAssembly
Character field with length validation
CheckConstraintdatabase and non-WebAssembly
CHECK constraint (similar to Django’s CheckConstraint)
ChoiceInforest and non-WebAssembly
Choice information for choice fields
Claimsauth-jwt and non-WebAssembly
JWT Claims
ClientPathclient-router
Single path parameter extractor.
ClientPathPatternclient-router
Represents a compiled path pattern.
ClientRouteclient-router
A single route definition.
ClientRouteMatchclient-router
A matched route with extracted parameters.
ClientRouterclient-router
The main client-side router.
Componentsopenapi and non-WebAssembly
Implements OpenAPI Components Object which holds supported reusable objects.
Concatdatabase and non-WebAssembly
Concat - concatenate multiple strings
ConnectionPooldatabase and non-WebAssembly
A database connection pool
ConsumerContextwebsockets and non-WebAssembly
Consumer context containing connection and message information
ContentNegotiatorrest and non-WebAssembly
Content negotiator for selecting appropriate renderer
ContentTypedatabase and non-WebAssembly
Represents a content type (model) in the system
ContentTypeRegistrydatabase and non-WebAssembly
Registry for managing content types
Cookie(minimal or standard or di) and non-WebAssembly
Extract a value from cookies
CookieParamopenapi and non-WebAssembly
Marker type for Cookie parameter metadata
CoreSettingsconf and non-WebAssembly
Core application settings.
CorsMiddlewaremiddleware-cors and non-WebAssembly
CORS middleware
CorsSettingsconf and non-WebAssembly
CORS settings
CreateGroupDataauth and non-WebAssembly
Group creation data
CreateUserDataauth and non-WebAssembly
User data for creation
CreditCardValidatorcore and non-WebAssembly
Credit card number validator
CurrentDatedatabase and non-WebAssembly
CurrentDate - current date
CurrentTimedatabase and non-WebAssembly
CurrentTime - current time
CurrentUserDeprecatedauth and non-WebAssembly
Wrapper type representing the currently authenticated user for DI.
CursorPaginationrest and non-WebAssembly
Cursor-based pagination for large datasets
DatabaseConfigconf and non-WebAssembly
Database configuration
DatabaseConnectiondatabase and non-WebAssembly
Database connection wrapper
DefaultRouterNon-WebAssembly
Default router implementation Similar to Django REST Framework’s DefaultRouter and Django’s URLResolver
DefaultSourceconf and non-WebAssembly
Default values configuration source
DefaultUserDeprecatedauth and argon2-hasher
DefaultUser struct - Django’s AbstractUser equivalent
DefaultUserManagerauth and argon2-hasher
DefaultUserManager - In-memory user manager for DefaultUser
DenseRankdatabase and non-WebAssembly
DENSE_RANK window function
Dependsdi and non-WebAssembly
Dependency injection wrapper similar to FastAPI’s Depends.
DependsBuilderdi and non-WebAssembly
Builder for Depends to support FastAPI-style API.
DetailViewNon-WebAssembly
DetailView for displaying a single object
EmailFieldforms and non-WebAssembly
Email field with format validation
EmailSettingsconf and non-WebAssembly
Email settings
EmailValidatorcore and non-WebAssembly
Email address validator
EndpointInspectoropenapi and non-WebAssembly
Endpoint inspector for function-based routes
EndpointMetadatacore and non-WebAssembly
Endpoint metadata for OpenAPI generation
EnumSchemaBuilderopenapi and non-WebAssembly
Builder for enum schemas
EnvSourceconf and non-WebAssembly
Environment variable configuration source
Existsdatabase and non-WebAssembly
Exists - check if a subquery returns any rows
Extensionscore and non-WebAssembly
Type-safe extension storage
Extractdatabase and non-WebAssembly
Extract component from date/time
Fdatabase and non-WebAssembly
F expression - represents a database field reference Similar to Django’s F() objects for database-side operations
FieldInforest and non-WebAssembly
Field metadata information
FieldInfoBuilderrest and non-WebAssembly
Builder for field information
FieldMetadataopenapi and non-WebAssembly
Field metadata extracted from serde attributes
FieldRefdatabase and non-WebAssembly
Type-safe field reference for database operations
FieldStatedatabase and non-WebAssembly
Field state for migration detection
FileFieldforms and non-WebAssembly
FileField for file upload
FileUploadParserrest and non-WebAssembly
Raw file upload parser
Filterdatabase and non-WebAssembly
Represents a filter.
FirstValuedatabase and non-WebAssembly
FIRST_VALUE window function
Floordatabase and non-WebAssembly
Floor - round down to nearest integer
ForeignKeyConstraintdatabase and non-WebAssembly
Foreign Key constraint
Formforms and non-WebAssembly
Form data structure (Phase 2-A: Enhanced with client-side validation rules)
FormParserrest and non-WebAssembly
Form parser for application/x-www-form-urlencoded content type
Framedatabase and non-WebAssembly
Window frame specification
GenericForeignKeydatabase and non-WebAssembly
Generic foreign key field
GenericRelationQuerydatabase and non-WebAssembly
Helper for building generic relation queries
GenericViewSetNon-WebAssembly
Generic ViewSet implementation Composes functionality through trait bounds
GinIndexdatabase and non-WebAssembly
GIN index (for arrays, JSONB, full-text search)
GistIndexdatabase and non-WebAssembly
GiST index (for geometric data, full-text search)
Greatestdatabase and non-WebAssembly
Greatest - return the maximum value among expressions
Groupauth and non-WebAssembly
User group
GroupManagerauth and non-WebAssembly
Group manager
HashIndexdatabase and non-WebAssembly
Hash index
Header(minimal or standard or di) and non-WebAssembly
Extract a value from request headers
HeaderParamopenapi and non-WebAssembly
Marker type for Header parameter metadata
HistoryStateclient-router
State object stored in the history entry.
HostNameVersioningrest and non-WebAssembly
Hostname versioning
HttpSessionConfigsessions and middleware and non-WebAssembly
HTTP session configuration
IBANValidatorcore and non-WebAssembly
IBAN validator implementing ISO 13616 standard
IPAddressValidatorcore and non-WebAssembly
IP Address validator - validates IPv4 and IPv6 addresses using std::net::IpAddr
InMemoryCachecache and non-WebAssembly
In-memory cache backend
InMemorySessionBackendsessions and non-WebAssembly
In-memory session backend
InMemoryStoragestorage and non-WebAssembly
In-memory storage backend
Indexdatabase and non-WebAssembly
Index definition
Infoopenapi and non-WebAssembly
OpenAPI Info object represents metadata of the API.
Injecteddi and non-WebAssembly
Injected dependency wrapper
InjectionContextdi and non-WebAssembly
The main injection context for dependency resolution.
InjectionContextBuilderdi and non-WebAssembly
Builder for constructing InjectionContext instances.
InjectionMetadatadi and non-WebAssembly
Injection metadata
IntegerFieldforms and non-WebAssembly
Integer field with range validation
IsAdminUserauth and non-WebAssembly
IsAdminUser - requires the user to be an admin
IsAuthenticatedauth and non-WebAssembly
IsAuthenticated - requires the user to be authenticated
JSONParserrest and non-WebAssembly
JSON parser for application/json content type
Json(minimal or standard or di) and non-WebAssembly
Extract and deserialize JSON from request body
JsonSerializerrest and non-WebAssembly
JSON serializer implementation
JwtAuthauth-jwt and non-WebAssembly
JWT Authentication handler
Lagdatabase and non-WebAssembly
LAG window function
LastValuedatabase and non-WebAssembly
LAST_VALUE window function
Leaddatabase and non-WebAssembly
LEAD window function
Leastdatabase and non-WebAssembly
Least - return the minimum value among expressions
Lengthdatabase and non-WebAssembly
Length - return the length of a string
LimitOffsetPaginationrest and non-WebAssembly
Limit/offset based pagination
ListViewNon-WebAssembly
ListView for displaying multiple objects
LocalStoragestorage and non-WebAssembly
Local filesystem storage
LoggingMiddleware(standard or middleware) and non-WebAssembly
Django-style request logging middleware with colored output
LoggingSettingsconf and non-WebAssembly
Logging settings
LowPriorityEnvSourceconf and non-WebAssembly
Low-priority environment variable configuration source
Lowerdatabase and non-WebAssembly
Lower - convert string to lowercase
M2MChangeEventcore and non-WebAssembly
M2M changed signal - sent when many-to-many relationships change
MediaSettingsconf and non-WebAssembly
Media files settings
MediaTyperest and non-WebAssembly
Media type representation
MetadataOptionsrest and non-WebAssembly
Options for configuring metadata
MetadataResponserest and non-WebAssembly
Complete metadata response
MethodNon-WebAssembly
The Request Method (VERB)
MiddlewareChaincore and non-WebAssembly
Middleware chain - composes multiple middleware into a single handler.
MiddlewareConfigconf and non-WebAssembly
Middleware configuration
Migrationdatabase and non-WebAssembly
A database migration
MigrationAutodetectordatabase and non-WebAssembly
Migration autodetector
MigrationPlandatabase and non-WebAssembly
Migration execution plan
MigrationRecorderdatabase and non-WebAssembly
Migration recorder (in-memory only, for backward compatibility)
Moddatabase and non-WebAssembly
Mod - modulo operation
ModelFormforms and non-WebAssembly
A form that is automatically generated from a Model
ModelStatedatabase and non-WebAssembly
Model state for migration detection
ModelViewSetNon-WebAssembly
ModelViewSet - combines all CRUD mixins Similar to Django REST Framework’s ModelViewSet but using composition
MultiPartParserrest and non-WebAssembly
MultiPart parser for multipart/form-data content type (file uploads)
MultiTermSearchrest and non-WebAssembly
Combines multiple search terms across multiple fields
NTiledatabase and non-WebAssembly
NTILE window function
NamespaceVersioningrest and non-WebAssembly
Namespace versioning (URL namespace-based)
Nowdatabase and non-WebAssembly
Now - current timestamp
NthValuedatabase and non-WebAssembly
NTH_VALUE window function
NullIfdatabase and non-WebAssembly
NullIf - return NULL if two expressions are equal
ObjectBuilderopenapi and non-WebAssembly
Builder for Object with chainable configuration methods to create a new Object.
ObjectPermissionauth and non-WebAssembly
Object permission with Permission trait support
ObjectPermissionManagerauth and non-WebAssembly
Object permission manager
OpenApiConfigopenapi and non-WebAssembly
Configuration for OpenAPI endpoint mounting
OpenApiRouteropenapi-router and non-WebAssembly
Router wrapper that adds OpenAPI documentation endpoints
OpenApiSchemaopenapi and non-WebAssembly
Root object of the OpenAPI document.
Operationopenapi and non-WebAssembly
Implements OpenAPI Operation Object object.
OuterRefdatabase and non-WebAssembly
OuterRef - reference to a field in the outer query (for subqueries)
PageNumberPaginationrest and non-WebAssembly
Page number based pagination
PagesAuthenticatorwebsockets-pages and non-WebAssembly
Authenticator that integrates with reinhardt-pages’ Cookie/session authentication
PaginatedResponserest and non-WebAssembly
Paginated response wrapper
ParamContextclient-router
Context for parameter extraction.
Parameteropenapi and non-WebAssembly
Implements OpenAPI Parameter Object for Operation.
Path(minimal or standard or di) and non-WebAssembly
Extract a single value from the URL path
PathItemopenapi and non-WebAssembly
Implements OpenAPI Path Item Object what describes Operations available on a single path.
PathMatcherNon-WebAssembly
Path matcher - uses composition to match paths
PathParamopenapi and non-WebAssembly
Marker type for Path parameter metadata
PathPatternNon-WebAssembly
Path pattern for URL matching Similar to Django’s URL patterns but using composition
PhoneNumberValidatorcore and non-WebAssembly
Phone number validator for international phone numbers
PoolConfigdatabase and non-WebAssembly
Represents a pool config.
Powerdatabase and non-WebAssembly
Power - raise to a power
ProjectStatedatabase and non-WebAssembly
Project state for migration detection
Query(minimal or standard or di) and non-WebAssembly
Extract query parameters from the URL
QueryParamopenapi and non-WebAssembly
Marker type for Query parameter metadata
QueryParameterVersioningrest and non-WebAssembly
Query parameter versioning
QuerySetdatabase and non-WebAssembly
Represents a query set.
Rankdatabase and non-WebAssembly
RANK window function
ReadOnlyModelViewSetNon-WebAssembly
ReadOnlyModelViewSet - only list and retrieve Demonstrates selective composition of mixins
RedisCachecache and redis-backend and non-WebAssembly
Redis cache backend with connection pooling
RedocUIopenapi and non-WebAssembly
Redoc UI handler (alternative to Swagger UI)
RendererInforest and non-WebAssembly
Renderer information for testing
Requestcore and non-WebAssembly
HTTP Request representation
RequestBodyopenapi and non-WebAssembly
Implements OpenAPI Request Body.
RequestContextdi and non-WebAssembly
Context for per-request dependency injection resolution.
RequestScopedi and non-WebAssembly
Per-request dependency cache that stores resolved instances for the duration of a request.
Responsecore and non-WebAssembly
HTTP Response representation
RoomManagerwebsockets and non-WebAssembly
Manages multiple WebSocket rooms
Rounddatabase and non-WebAssembly
Round - round to specified decimal places
RouteNon-WebAssembly
Route definition Uses composition to combine path patterns with handlers Similar to Django’s URLPattern
RowNumberdatabase and non-WebAssembly
ROW_NUMBER window function
Savepointdatabase and non-WebAssembly
Savepoint for nested transactions
Schedulertasks and non-WebAssembly
Task scheduler for managing periodic tasks
SchemaBuilderExtopenapi and non-WebAssembly
Schema builder with serde attribute support
SchemaGeneratoropenapi and non-WebAssembly
Schema generator for OpenAPI schemas
SchemaRegistrationopenapi and non-WebAssembly
Compile-time schema registration metadata
SchemaRegistryopenapi and non-WebAssembly
A registry for managing reusable OpenAPI schemas
ScopedRateThrottlerest and non-WebAssembly
Scope-based rate throttle with per-scope rate limits.
Serveropenapi and non-WebAssembly
Represents target server object. It can be used to alter server connection for path operations.
ServerRouterNon-WebAssembly
Unified router with hierarchical routing support
Sessionsessions and non-WebAssembly
Django-style session object with dictionary-like interface
SessionMiddlewaresessions and middleware and non-WebAssembly
Session middleware
SessionSettingsconf and non-WebAssembly
Session settings
SettingsDeprecatedconf and non-WebAssembly
Main settings structure for a Reinhardt project
SettingsBuilderconf and non-WebAssembly
Settings builder for layered configuration
Signalcore and non-WebAssembly
A signal that can dispatch events to connected receivers
SimpleMetadatarest and non-WebAssembly
Simple metadata implementation
SimpleUserauth and non-WebAssembly
Simple user implementation with basic fields
SingletonScopedi and non-WebAssembly
Application-wide dependency cache that persists across all requests.
SoftDeletedatabase and non-WebAssembly
Soft delete field that can be composed into structs
Sqrtdatabase and non-WebAssembly
Sqrt - square root
StaticSettingsconf and non-WebAssembly
Static files settings
StatusCodeNon-WebAssembly
An HTTP status code (status-code in RFC 9110 et al.).
Subquerydatabase and non-WebAssembly
Subquery - represents a subquery expression
Substrdatabase and non-WebAssembly
Substr - extract a substring
SwaggerUIopenapi and non-WebAssembly
Swagger UI handler
Tagopenapi and non-WebAssembly
Implements OpenAPI Tag Object.
TaskQueuetasks and non-WebAssembly
A task queue that delegates to a backend for task storage and retrieval.
TemplateConfigconf and non-WebAssembly
Template engine configuration
TestResponsetest and non-WebAssembly
Test response wrapper
Timestampsdatabase and non-WebAssembly
Common timestamp fields that can be composed into structs
TomlFileSourceconf and non-WebAssembly
TOML file configuration source
Transactiondatabase and non-WebAssembly
Transaction manager
TransactionScopedatabase and non-WebAssembly
Transaction scope guard with automatic rollback on drop
Trimdatabase and non-WebAssembly
Trim - remove leading and trailing whitespace
URLPathVersioningrest and non-WebAssembly
URL path versioning
UnifiedRouterclient-router
Unified router combining server and client routing capabilities.
UniqueConstraintdatabase and non-WebAssembly
UNIQUE constraint (similar to Django’s UniqueConstraint)
UpdateUserDataauth and non-WebAssembly
User data for update
Upperdatabase and non-WebAssembly
Upper - convert string to uppercase
UrlPatternsRegistrationNon-WebAssembly
URL patterns registration for compile-time discovery
UrlReverserNon-WebAssembly
URL reverser for resolving names back to URLs Similar to Django’s URLResolver reverse functionality
UrlValidatorcore and non-WebAssembly
URL validator
UserManagerauth and non-WebAssembly
User manager
UserRateThrottlerest and non-WebAssembly
Rate throttle for authenticated user requests.
ValidationErrorscore and non-WebAssembly
Aggregates validation errors by field name.
VersioningMiddlewarerest and non-WebAssembly
Middleware for automatic API version detection
WebSocketRoutewebsockets and non-WebAssembly
WebSocket route information
WebSocketRouterwebsockets and non-WebAssembly
WebSocket router for managing routes
Windowdatabase and non-WebAssembly
Window specification

Enums§

ActionTypeNon-WebAssembly
Action type for ViewSet operations
AggregateFuncdatabase and non-WebAssembly
Aggregate function types
AggregateValuedatabase and non-WebAssembly
Result of an aggregation
AnnotationValuedatabase and non-WebAssembly
Represents an annotation value that can be added to a QuerySet
AppErrorcore and non-WebAssembly
Errors that can occur when working with the application registry
DatabaseBackenddatabase and non-WebAssembly
Defines possible database backend values.
DiErrordi and non-WebAssembly
Errors that can occur during dependency injection resolution.
EnumTaggingopenapi and non-WebAssembly
Enum tagging strategy
Errorcore and non-WebAssembly
The main error type for the Reinhardt framework.
ExtractComponentdatabase and non-WebAssembly
Defines possible extract component values.
FieldErrorforms and non-WebAssembly
Error type returned when field validation fails.
FieldTyperest and non-WebAssembly
Field type enumeration for metadata
FilterErrorrest and non-WebAssembly
Errors that can occur during query filtering.
FilterOperatordatabase and non-WebAssembly
Defines possible filter operator values.
FilterValuedatabase and non-WebAssembly
Defines possible filter value values.
FormErrorforms and non-WebAssembly
Error type returned when form-level validation fails.
FrameBoundarydatabase and non-WebAssembly
Frame boundary
FrameTypedatabase and non-WebAssembly
Window frame type
GroupManagementErrorauth and non-WebAssembly
Group management error
IsolationLeveldatabase and non-WebAssembly
Transaction isolation levels
JwtErrorauth-jwt and non-WebAssembly
JWT-specific errors with distinct variants for each failure mode.
M2MActioncore and non-WebAssembly
Actions that can occur on a many-to-many relationship.
Messagewebsockets and non-WebAssembly
WebSocket message types
MigrationErrordatabase and non-WebAssembly
Errors that can occur during migration operations.
NavigationTypeclient-router
The type of navigation that occurred.
NegotiationErrorrest and non-WebAssembly
Error type for negotiation failures
Numberopenapi and non-WebAssembly
Flexible number wrapper used by validation schema attributes to seamlessly support different number syntaxes.
OnDeletedatabase and non-WebAssembly
Defines possible on delete values.
OnUpdatedatabase and non-WebAssembly
Defines possible on update values.
Orderdatabase and non-WebAssembly
Ordering direction for ORDER BY clauses.
ParameterLocationopenapi and non-WebAssembly
In definition of Parameter.
PoolErrordatabase and non-WebAssembly
Defines possible pool error values.
Profileconf and non-WebAssembly
Application profile/environment
Qdatabase and non-WebAssembly
Q object - represents a complex query condition Similar to Django’s Q() objects for building complex queries
QOperatordatabase and non-WebAssembly
Q operator for combining query conditions
QueryBuilderValuedatabase and non-WebAssembly
Core value representation for SQL parameters.
QueryValuedatabase and non-WebAssembly
Query value types
RefOropenapi and non-WebAssembly
A Ref or some other type T.
RenameAllopenapi and non-WebAssembly
Rename transformation strategy
Requiredopenapi and non-WebAssembly
Value used to indicate whether parameter or property is required.
RouteErrorwebsockets and non-WebAssembly
Routing errors
SameSitesessions and middleware and non-WebAssembly
SameSite cookie attribute
Schemaopenapi and non-WebAssembly
Is super type for OpenAPI Schema Object. Schema is reusable resource what can be referenced from path operations and other components using Ref.
SchemaErroropenapi and non-WebAssembly
Errors that can occur during OpenAPI schema operations.
Scopedi and non-WebAssembly
Defines the lifetime scope of a dependency.
SessionErrorsessions and non-WebAssembly
Session backend errors
SettingsErrorconf and non-WebAssembly
Settings error
SqlTypedatabase and non-WebAssembly
Defines possible sql type values.
TrimTypedatabase and non-WebAssembly
Defines possible trim type values.
UserManagementErrorauth and non-WebAssembly
User management error
ValidatorErrorcore and non-WebAssembly
Validation errors produced by validators.
VersioningErrorrest and non-WebAssembly
Errors that can occur during API version determination.
WebSocketErrorwebsockets and non-WebAssembly
Errors that can occur during WebSocket operations.

Statics§

CONTENT_TYPE_REGISTRYdatabase and non-WebAssembly
Global content type registry.

Traits§

ApplyUpdate
Trait for applying partial updates from one struct to another.
AuthBackendauth and non-WebAssembly
Authentication backend trait
BaseContentNegotiationrest and non-WebAssembly
Base content negotiator trait
BaseMetadatarest and non-WebAssembly
Base trait for metadata providers
BaseUserauth and non-WebAssembly
BaseUser trait - Django-style authentication
BaseVersioningrest and non-WebAssembly
Base trait for API versioning strategies
Cachecache and non-WebAssembly
Base cache trait
ComponentsExtopenapi and non-WebAssembly
Extension trait for Components to provide convenient methods
Constraintdatabase and non-WebAssembly
Base trait for all constraints
CreateMixinNon-WebAssembly
Create mixin - provides create() action
Deserializerrest and non-WebAssembly
Deserializer trait for one-way deserialization
DestroyMixinNon-WebAssembly
Destroy mixin - provides destroy() action
FieldOrderingExtrest and non-WebAssembly
Extension trait to add ordering methods to Field
FilterBackendrest and non-WebAssembly
A backend that applies query parameter filters to a SQL query string.
FromPathclient-router
Trait for extracting typed values from path parameters.
FullUserauth and non-WebAssembly
FullUser trait - Django’s AbstractUser equivalent
GenericRelatabledatabase and non-WebAssembly
Trait for models that can be targets of generic relations
Handlercore and non-WebAssembly
Handler trait for processing requests.
HasCoreSettingsconf and non-WebAssembly
Trait for accessing CoreSettings from a composed settings type.
HasSettingsconf and non-WebAssembly
Generic accessor trait for settings fragments.
Injectabledi and non-WebAssembly
Injectable trait for dependencies.
IntoValuedatabase and non-WebAssembly
Trait for converting Rust types to SQL values.
ListMixinNon-WebAssembly
Mixin traits for ViewSet functionality These use composition instead of multiple inheritance List mixin - provides list() action
Middlewarecore and non-WebAssembly
Middleware trait for request/response processing.
Modeldatabase and non-WebAssembly
Core trait for database models Uses composition instead of inheritance - models can implement multiple traits
ModelTypedatabase and non-WebAssembly
Trait for models that can be registered as content types
MultipleObjectMixinNon-WebAssembly
Trait for views that work with multiple objects
ObjectPermissionCheckerauth and non-WebAssembly
Object permission checker trait
OpenApiSchemaExtopenapi and non-WebAssembly
Extension trait for OpenApiSchema to provide convenient methods
OperationExtopenapi and non-WebAssembly
Extension trait for Operation to provide convenient methods
Paginatorrest and non-WebAssembly
Trait for pagination implementations
ParameterExtopenapi and non-WebAssembly
Extension trait for Parameter to provide convenient constructors
ParameterMetadataopenapi and non-WebAssembly
Trait for types that can provide OpenAPI parameter metadata
Parserrest and non-WebAssembly
Trait for request body parsers
PasswordHasherauth and non-WebAssembly
Password hasher trait
PathItemExtopenapi and non-WebAssembly
Extension trait for PathItem to provide constructor
Permissionauth and non-WebAssembly
Permission trait - defines permission checking interface
PermissionsMixinauth and non-WebAssembly
PermissionsMixin trait - Django’s PermissionsMixin equivalent
RequestVersionExtrest and non-WebAssembly
Extension trait to get API version from request
ResponsesExtopenapi and non-WebAssembly
Extension trait for Responses to provide collection methods
RetrieveMixinNon-WebAssembly
Retrieve mixin - provides retrieve() action
RouterNon-WebAssembly
Router trait - composes routes together
SchemaExtopenapi and non-WebAssembly
Extension trait for Schema to provide convenient constructor methods
Serializerrest and non-WebAssembly
Core serializer trait for converting between input and output representations
SessionBackendsessions and non-WebAssembly
Session backend trait
SettingsFragmentconf and non-WebAssembly
A composable unit of configuration.
SingleFromPathclient-router
Trait for extracting a single value at a specific index from path parameters.
SingleObjectMixinNon-WebAssembly
Trait for views that work with a single object
SoftDeletabledatabase and non-WebAssembly
Trait for soft-deletable models Another composition trait instead of inheritance
Storagestorage and non-WebAssembly
Trait for file storage backends
Tasktasks and non-WebAssembly
Core trait that all tasks must implement, providing identity and metadata.
TaskExecutortasks and non-WebAssembly
Trait for tasks that can be executed asynchronously.
Throttlerest and non-WebAssembly
Core trait for rate-limiting strategies.
Timestampeddatabase and non-WebAssembly
Trait for models with timestamps - compose this with Model This follows Rust’s composition pattern rather than Django’s inheritance
ToSchemaopenapi and non-WebAssembly
Trait for types that can generate OpenAPI schemas
TransactionExecutordatabase and non-WebAssembly
Transaction executor trait for database-specific transaction handling
UpdateMixinNon-WebAssembly
Update mixin - provides update() action
UrlPatternNon-WebAssembly
Trait for URL patterns that can be reversed at compile time
UrlPatternWithParamsNon-WebAssembly
Trait for URL patterns with parameters
UserDeprecatedauth and non-WebAssembly
User trait - Core authentication trait
Validatecore and non-WebAssembly
Trait for struct-level validation.
Validatorcore and non-WebAssembly
Trait for validators
ViewNon-WebAssembly
Base trait for all generic views
ViewSetNon-WebAssembly
ViewSet trait - similar to Django REST Framework’s ViewSet Uses composition of mixins instead of inheritance
WebSocketConsumerwebsockets and non-WebAssembly
WebSocket consumer trait
WindowFunctiondatabase and non-WebAssembly
Base trait for window functions

Functions§

atomicdatabase and non-WebAssembly
Execute a function within a transaction scope
atomic_with_isolationdatabase and non-WebAssembly
Execute a function within a transaction with specific isolation level
clear_routerNon-WebAssembly
Clear the registered router (useful for tests)
clear_websocket_routerwebsockets and non-WebAssembly
Clear the global WebSocket router
generate_openapi_schemaopenapi and non-WebAssembly
Generate OpenAPI schema from global registry
get_list_or_404shortcuts and database and non-WebAssembly
Get a list of objects from the database or return a 404 response if empty
get_object_or_404shortcuts and database and non-WebAssembly
Get a single object from the database or return a 404 response
get_routerNon-WebAssembly
Get a reference to the globally registered router
get_websocket_routerwebsockets and non-WebAssembly
Get the global WebSocket router
includeNon-WebAssembly
Create an IncludedRouter from a list of routes Similar to Django’s include() function
is_router_registeredNon-WebAssembly
Check if a router has been registered
m2m_changedcore and non-WebAssembly
Returns the M2M changed signal for the given model types.
pathNon-WebAssembly
Create a route using simple path syntax Similar to Django’s path() function
post_deletecore and non-WebAssembly
Post-delete signal - sent after a model instance is deleted
post_savecore and non-WebAssembly
Post-save signal - sent after a model instance is saved
pre_deletecore and non-WebAssembly
Pre-delete signal - sent before a model instance is deleted
pre_savecore and non-WebAssembly
Pre-save signal - sent before a model instance is saved
re_pathNon-WebAssembly
Create a route using regex syntax Similar to Django’s re_path() function
redirectshortcuts and non-WebAssembly
Create a validated temporary redirect (HTTP 302) to the specified URL.
register_routerNon-WebAssembly
Register the application’s main router globally
register_router_arcNon-WebAssembly
Register a router that is already wrapped in Arc
register_websocket_routerwebsockets and non-WebAssembly
Register a global WebSocket router
render_htmlshortcuts and non-WebAssembly
Render a simple HTML string and return an HTTP 200 response
render_jsonshortcuts and non-WebAssembly
Render data as JSON and return an HTTP 200 response, or an error if serialization fails
render_textshortcuts and non-WebAssembly
Render a simple text string and return an HTTP 200 response
reverseNon-WebAssembly
Standalone reverse function for convenience Similar to Django’s reverse() function
reverse_websocket_urlwebsockets and non-WebAssembly
URL reverse lookup for WebSocket routes
validate_auth_extractorsauth and non-WebAssembly
Validates that the DI context is properly configured for auth extractors.

Type Aliases§

AppResultcore and non-WebAssembly
A specialized Result type for application operations.
ContextNon-WebAssembly
Context data for template rendering
DiResultdi and non-WebAssembly
A specialized Result type for dependency injection operations.
FilterResultrest and non-WebAssembly
A convenience type alias for filter operation results.
FormResultforms and non-WebAssembly
Result type alias for form-level operations.
GroupManagementResultauth and non-WebAssembly
Group management result
OptionalInjecteddi and non-WebAssembly
Optional injected dependency
ParseErrorrest and non-WebAssembly
Type alias for parser errors, using the framework’s Error type.
ParseResultrest and non-WebAssembly
Type alias for parser results, using the framework’s Result type.
Resultcore and non-WebAssembly
A convenient Result type alias using reinhardt_core::exception::Error as the error type.
RouteResultwebsockets and non-WebAssembly
Routing result type
SchemaObjectopenapi and non-WebAssembly
A complete schema object with metadata This is an alias to utoipa’s Schema for convenience
SchemaResultopenapi and non-WebAssembly
Result type for OpenAPI schema operations.
UserManagementResultauth and non-WebAssembly
User management result
ValidationResultcore and non-WebAssembly
Result type for validation operations.
ViewResultcore and non-WebAssembly
A convenient type alias for view/endpoint function return types.
WebSocketResultwebsockets and non-WebAssembly
A specialized Result type for WebSocket operations.

Attribute Macros§

adminadmin and non-WebAssembly
Attribute macro for ModelAdmin configuration
api_viewNon-WebAssembly
Decorator for function-based API views
app_configcore and non-WebAssembly
Attribute macro for Django-style AppConfig definition with automatic derive
apply_updateNon-WebAssembly
Attribute macro for applying partial updates to target structs
deleteNon-WebAssembly
DELETE method decorator
getNon-WebAssembly
GET method decorator
modeldatabase and non-WebAssembly
Attribute macro for Django-style model definition with automatic derive
patchNon-WebAssembly
PATCH method decorator
postNon-WebAssembly
POST method decorator
putNon-WebAssembly
PUT method decorator
routesNon-WebAssembly
Register URL patterns for automatic discovery by the framework
settingsconf and non-WebAssembly
Settings attribute macro for composable configuration.

Derive Macros§

AppConfigcore and non-WebAssembly
Derive macro for automatic AppConfig factory method generation
DeriveApplyUpdateNon-WebAssembly
Derive macro for automatic ApplyUpdate trait implementation
Modeldatabase and non-WebAssembly
Derive macro for automatic Model implementation and migration registration
Schemaopenapi and non-WebAssembly
Derive macro for automatic OpenAPI schema generation.
Validatecore and non-WebAssembly
Derive macro for struct-level validation